Documentation ¶
Index ¶
- func DecodeProtoJsonHook(v proto.Message) viper.DecoderConfigOption
- func Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func UnmarshalExact(rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func UnmarshalExactViper(v *viper.Viper, rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func UnmarshalKeyViper(v *viper.Viper, key string, rawVal interface{}, ...) error
- func UnmarshalKeys(keys []string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
- func UnmarshalKeysExactViper(v *viper.Viper, keys []string, rawVal interface{}, ...) error
- func UnmarshalKeysViper(v *viper.Viper, keys []string, rawVal interface{}, ...) error
- func UnmarshalProtoMessageHookFunc(def proto.Message) mapstructure.DecodeHookFunc
- func UnmarshalViper(v *viper.Viper, rawVal interface{}, opts ...viper.DecoderConfigOption) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeProtoJsonHook ¶
func DecodeProtoJsonHook(v proto.Message) viper.DecoderConfigOption
DecodeProtoJsonHook if set, will be called before any decoding and any type conversion (if WeaklyTypedInput is on). This lets you modify the values before they're set down onto the resulting struct.
If an error is returned, the entire decode will fail with that error.
func Unmarshal ¶
func Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
Unmarshal unmarshalls the config into a Struct. Make sure that the tags on the fields of the structure are properly set. use protojson to decode if rawVal is proto.Message
func UnmarshalExact ¶
func UnmarshalExact(rawVal interface{}, opts ...viper.DecoderConfigOption) error
UnmarshalExact unmarshals the config into a Struct, erroring if a field is nonexistent in the destination struct. use protojson to decode if rawVal is proto.Message
func UnmarshalExactViper ¶
func UnmarshalExactViper(v *viper.Viper, rawVal interface{}, opts ...viper.DecoderConfigOption) error
func UnmarshalKey ¶
func UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
UnmarshalKey takes a single key and unmarshalls it into a Struct. use protojson to decode if rawVal is proto.Message
func UnmarshalKeyViper ¶
func UnmarshalKeys ¶
func UnmarshalKeys(keys []string, rawVal interface{}, opts ...viper.DecoderConfigOption) error
func UnmarshalKeysExactViper ¶ added in v1.2.67
func UnmarshalKeysViper ¶
func UnmarshalProtoMessageHookFunc ¶
func UnmarshalProtoMessageHookFunc(def proto.Message) mapstructure.DecodeHookFunc
UnmarshalProtoMessageHookFunc returns a DecodeHookFunc that converts root struct to config.ViperProto. Trick of protobuf, which generates json tag only def is the default value of dst
func UnmarshalViper ¶
func UnmarshalViper(v *viper.Viper, rawVal interface{}, opts ...viper.DecoderConfigOption) error
Types ¶
This section is empty.