Documentation ¶
Index ¶
- func AddFlags(r *pflag.FlagSet, config interface{}) error
- func BindEnv(r ConfigRegistry, config interface{}) error
- func DefaultDecodeHooks() []mapstructure.DecodeHookFunc
- func SetDefaults(r ConfigRegistry, config interface{}) error
- func StringToTCPAddrHookFunc() mapstructure.DecodeHookFunc
- func StringToUDPAddrHookFunc() mapstructure.DecodeHookFunc
- type ConfigRegistry
- type Pather
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFlags ¶ added in v0.1.3
AddFlags adds flags to the provided flag set based on the config struct. Default are set according to the values present in the config struct.
func BindEnv ¶ added in v0.1.3
func BindEnv(r ConfigRegistry, config interface{}) error
BindEnv binds the environemt variables based on the config struct.
func DefaultDecodeHooks ¶ added in v0.1.3
func DefaultDecodeHooks() []mapstructure.DecodeHookFunc
DefaultDecodeHooks returns a list of useful decoding hooks.
func SetDefaults ¶ added in v0.1.3
func SetDefaults(r ConfigRegistry, config interface{}) error
SetDefaults sets the default values based on the values contained in the provided config struct.
func StringToTCPAddrHookFunc ¶ added in v0.1.3
func StringToTCPAddrHookFunc() mapstructure.DecodeHookFunc
StringToTCPAddrHookFunc returns a DecodeHookFunc that converts strings to net.TCPAddr
func StringToUDPAddrHookFunc ¶ added in v0.1.3
func StringToUDPAddrHookFunc() mapstructure.DecodeHookFunc
StringToUDPAddrHookFunc returns a DecodeHookFunc that converts strings to net.UDPAddr
Types ¶
type ConfigRegistry ¶ added in v0.1.3
type ConfigRegistry interface { BindEnv(input ...string) error SetDefault(key string, value interface{}) }
ConfigRegistry is an abstraction of viper.Viper.
Click to show internal directories.
Click to hide internal directories.