Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bind ¶
func Bind(outPtr interface{}, v *viper.Viper, options BindOptions)
Bind binds the env vars to the config.
Parameters:
- outPtr: The pointer to the config struct.
- v: The viper instance.
- options: The options.
Types ¶
type BindOptions ¶
type BindOptions struct { AutoEnv bool // Whether to call viper.AutomaticEnv() or not. EnvPrefix string // The env prefix; calls viper.SetEnvPrefix() if not empty. AllowEmptyEnv bool // Whether to call viper.AllowEmptyEnv() or not. EnvKeyReplacer *strings.Replacer // The env key replacer; calls viper.SetEnvKeyReplacer() if not nil. }
BindOptions represents various options for binding env vars to the config.
Click to show internal directories.
Click to hide internal directories.