MCPcopy
hub / github.com/spf13/viper / EnvKeyReplacer

Function EnvKeyReplacer

viper.go:251–259  ·  view source on GitHub ↗

EnvKeyReplacer sets a replacer used for mapping environment variables to internal keys.

(r StringReplacer)

Source from the content-addressed store, hash-verified

249
250// EnvKeyReplacer sets a replacer used for mapping environment variables to internal keys.
251func 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.
262func WithDecodeHook(h mapstructure.DecodeHookFunc) Option {

Callers 1

TestEnvKeyReplacerFunction · 0.85

Calls 1

optionFuncFuncType · 0.85

Tested by 1

TestEnvKeyReplacerFunction · 0.68