Documentation
¶
Index ¶
- func Bool(key string, defaultValue bool, usage string) func() bool
- func BoolRequired(key, usage string) func() bool
- func Duration(key string, defaultValue time.Duration, usage string) func() time.Duration
- func DurationRequired(key, usage string) func() time.Duration
- func FetchLocalServiceConfig(path string) (interface{}, error)
- func FetchRemoteServiceConfig(watchRemoteConfig bool) (interface{}, error)
- func File(key, defaultValue, usage string) func() ([]byte, error)
- func FileRequired(key, usage string) func() ([]byte, error)
- func Float64(key string, defaultValue float64, usage string) func() float64
- func Float64Required(key, usage string) func() float64
- func GetConsulAddress() string
- func GetRemoteWatchPath() string
- func GetServiceName() string
- func GetWatchRemoteConfig() bool
- func ImportHookFunc() mapstructure.DecodeHookFunc
- func InitFlags()
- func Int(key string, defaultValue int, usage string) func() int
- func IntRequired(key, usage string) func() int
- func ListDegradedTags(tag string) []string
- func OnRemoteChange(cb func([]byte))
- func OverrideDefaultConfigFile(configFile string)
- func Parse()
- func SetAutoloadRemote(enabled bool)
- func SetForbidUnknownKeys(forbid bool)
- func SetForbiddenKeys(keys []string)
- func Slice(key string, defaultValue []string, usage string) func() []string
- func SliceRequired(key, usage string) func() []string
- func String(key, defaultValue, usage string) func() string
- func StringMapString(key string, defaultValue map[string]string, usage string) func() map[string]string
- func StringRequired(key, usage string) func() string
- func StringToProtoEnumHookFunc() mapstructure.DecodeHookFunc
- func Struct(key string, defaultValue interface{}, usage string) func(out interface{}) error
- func UnmarshalByStruct(input interface{}, rawVal interface{}, opts ...viper.DecoderConfigOption) error
- type EnumProto
- type HasDefault
- type HasValidator
- type ImportStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolRequired ¶
func DurationRequired ¶
func FetchLocalServiceConfig ¶
func FileRequired ¶
func Float64Required ¶
func GetConsulAddress ¶
func GetConsulAddress() string
func GetRemoteWatchPath ¶
func GetRemoteWatchPath() string
func GetServiceName ¶
func GetServiceName() string
GetServiceName returns special `service` flag always included in this library.
func GetWatchRemoteConfig ¶
func GetWatchRemoteConfig() bool
func ImportHookFunc ¶
func ImportHookFunc() mapstructure.DecodeHookFunc
func IntRequired ¶
func ListDegradedTags ¶
func OnRemoteChange ¶
func OnRemoteChange(cb func([]byte))
func OverrideDefaultConfigFile ¶
func OverrideDefaultConfigFile(configFile string)
OverrideDefaultConfigFile . Internal use only.
func SetAutoloadRemote ¶
func SetAutoloadRemote(enabled bool)
SetAutoloadRemote let user disable populating remote service config by default. User can use FetchRemoteServiceConfig to obtain the remote service config on demand.
func SetForbidUnknownKeys ¶
func SetForbidUnknownKeys(forbid bool)
SetForbidUnknownKeys controls whether an unknown key is allowed in arguments. Usually required when cooperating with other flags library.
func SetForbiddenKeys ¶
func SetForbiddenKeys(keys []string)
SetForbiddenKeys opts out certain keys from declaring.
func SliceRequired ¶
func StringMapString ¶
func StringRequired ¶
func StringToProtoEnumHookFunc ¶
func StringToProtoEnumHookFunc() mapstructure.DecodeHookFunc
func UnmarshalByStruct ¶ added in v1.0.1
func UnmarshalByStruct(input interface{}, rawVal interface{}, opts ...viper.DecoderConfigOption) error
Types ¶
type HasDefault ¶
type HasDefault interface {
SetDefault()
}
HasDefault indicates a flag struct which has default values.
type HasValidator ¶
type HasValidator interface {
Validate() error
}
type ImportStore ¶
Click to show internal directories.
Click to hide internal directories.