EnvKeyReplacer sets a replacer used for mapping environment variables to internal keys.
(r StringReplacer)
| 249 | |
| 250 | // EnvKeyReplacer sets a replacer used for mapping environment variables to internal keys. |
| 251 | func EnvKeyReplacer(r StringReplacer) Option { |
| 252 | return optionFunc(func(v *Viper) { |
| 253 | if r == nil { |
| 254 | return |
| 255 | } |
| 256 | |
| 257 | v.envKeyReplacer = r |
| 258 | }) |
| 259 | } |
| 260 | |
| 261 | // WithDecodeHook sets a default decode hook for mapstructure. |
| 262 | func WithDecodeHook(h mapstructure.DecodeHookFunc) Option { |