Documentation ¶
Index ¶
Constants ¶
View Source
const ( KiB = 1024 MiB = 1024 * KiB GiB = 1024 * MiB KB = 1000 MB = 1000 * KB GB = 1000 * MB )
Variables ¶
This section is empty.
Functions ¶
func ConvertTimeLayout ¶
func ParseSpec ¶
func ParseSpec(spec, tagName string, v interface{}, options ...SpecOptionsFn) error
ParseSpec parses a specification to a structure.
func ParseSpecMap ¶
ParseSpecMap parses the guava cache specification like string and returns a map listing the values specified for each key. ParseSpecMap always returns a non-nil map containing all the valid query parameters found; err describes the first decoding error encountered, if any.
Query is expected to be a list of key=value settings separated by ampersands or semicolons or comma. A setting without an equals sign is interpreted as a key set to an empty value.
Types ¶
type SpecOptions ¶
type SpecOptions struct {
EnvPrefix string
}
type SpecOptionsFn ¶
type SpecOptionsFn func(*SpecOptions)
func WithEnvPrefix ¶
func WithEnvPrefix(v string) SpecOptionsFn
type SpecOptionsFns ¶
type SpecOptionsFns []SpecOptionsFn
func (SpecOptionsFns) CreateOptions ¶
func (r SpecOptionsFns) CreateOptions() *SpecOptions
Click to show internal directories.
Click to hide internal directories.