Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustInit ¶
func MustInit(envPrefix string)
MustInit inits viper with provided env var prefix.
Note that it will panic and exit if any error happens.
func MustUnmarshalKey ¶
func MustUnmarshalKey(key string, valPtr interface{}, resolver ...ValueResolver)
MustUnmarshalKey unmarshal setting to value pointer by key from viper.
Note that it will panic and exit if failed to unmarshal value from key.
func UnmarshalKey ¶
func UnmarshalKey(key string, valPtr interface{}, resolver ...ValueResolver) error
UnmarshalKey unmarshal setting to value pointer by key from viper.
Provide custom value resolver if unmarshalling some special types like slice. Note that valPtr must be some value pointer and not be nil.
Types ¶
type ValueResolver ¶
ValueResolver defines custom method to get value by key from viper settings.
Click to show internal directories.
Click to hide internal directories.