{"modulePath":"github.com/EternizedLab/utils","version":"v1.0.2","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package flags\n\n## Functions\n\n```go\nfunc Bool(key string, defaultValue bool, usage string) func() bool\n```\n\n```go\nfunc BoolRequired(key, usage string) func() bool\n```\n\n```go\nfunc Duration(key string, defaultValue time.Duration, usage string) func() time.Duration\n```\n\n```go\nfunc DurationRequired(key, usage string) func() time.Duration\n```\n\n```go\nfunc FetchLocalServiceConfig(path string) (interface{}, error)\n```\n\n```go\nfunc FetchRemoteServiceConfig(watchRemoteConfig bool) (interface{}, error)\n```\n\n```go\nfunc File(key, defaultValue, usage string) func() ([]byte, error)\n```\n\n```go\nfunc FileRequired(key, usage string) func() ([]byte, error)\n```\n\n```go\nfunc Float64(key string, defaultValue float64, usage string) func() float64\n```\n\n```go\nfunc Float64Required(key, usage string) func() float64\n```\n\n```go\nfunc GetConsulAddress() string\n```\n\n```go\nfunc GetRemoteWatchPath() string\n```\n\n```go\nfunc GetServiceName() string\n```\nGetServiceName returns special \\`service\\` flag always included in this library.\n\n```go\nfunc GetWatchRemoteConfig() bool\n```\n\n```go\nfunc ImportHookFunc() mapstructure.DecodeHookFunc\n```\n\n```go\nfunc InitFlags()\n```\n\n```go\nfunc Int(key string, defaultValue int, usage string) func() int\n```\n\n```go\nfunc IntRequired(key, usage string) func() int\n```\n\n```go\nfunc ListDegradedTags(tag string) []string\n```\n\n```go\nfunc OnRemoteChange(cb func([]byte))\n```\n\n```go\nfunc OverrideDefaultConfigFile(configFile string)\n```\nOverrideDefaultConfigFile . Internal use only.\n\n```go\nfunc Parse()\n```\nParse has to called after main() before any application code.\n\n```go\nfunc SetAutoloadRemote(enabled bool)\n```\nSetAutoloadRemote let user disable populating remote service config by default. User can use FetchRemoteServiceConfig to obtain the remote service config on demand.\n\n```go\nfunc SetForbidUnknownKeys(forbid bool)\n```\nSetForbidUnknownKeys controls whether an unknown key is allowed in arguments. Usually required when cooperating with other flags library.\n\n```go\nfunc SetForbiddenKeys(keys []string)\n```\nSetForbiddenKeys opts out certain keys from declaring.\n\n```go\nfunc Slice(key string, defaultValue []string, usage string) func() []string\n```\n\n```go\nfunc SliceRequired(key, usage string) func() []string\n```\n\n```go\nfunc String(key, defaultValue, usage string) func() string\n```\n\n```go\nfunc StringMapString(key string, defaultValue map[string]string, usage string) func() map[string]string\n```\n\n```go\nfunc StringRequired(key, usage string) func() string\n```\n\n```go\nfunc StringToProtoEnumHookFunc() mapstructure.DecodeHookFunc\n```\n\n```go\nfunc Struct(key string, defaultValue interface{}, usage string) func(out interface{}) error\n```\n\n```go\nfunc UnmarshalByStruct(input interface{}, rawVal interface{}, opts ...viper.DecoderConfigOption) error\n```\n\n## Types\n\n```go\ntype EnumProto interface {\n\tEnumDescriptor() ([]byte, []int)\n}\n```\n\n```go\ntype HasDefault interface {\n\tSetDefault()\n}\n```\nHasDefault indicates a flag struct which has default values.\n\n```go\ntype HasValidator interface {\n\tValidate() error\n}\n```\n\n```go\ntype ImportStore interface {\n\tLoadValue(path string) ([]byte, error)\n}\n```\n\n","path":"github.com/EternizedLab/utils/flags","name":"flags","synopsis":"","isRedistributable":true}
