Documentation ¶
Index ¶
- func HCLHookFunc() mapstructure.DecodeHookFunc
- func Marshal(v zero.Interface, opts ...DecoderConfigOption) (map[string]zero.Interface, error)
- func Unmarshal(src zero.Interface, dst zero.Interface, opts ...DecoderConfigOption) error
- func UnmarshalerHookFunc() mapstructure.DecodeHookFunc
- type DecoderConfigOption
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HCLHookFunc ¶ added in v0.5.1
func HCLHookFunc() mapstructure.DecodeHookFunc
HCLHookFunc returns a mapstructure.DecodeHookFunc that helps unmarshal HCL configs by allowing weakly typed fields where slices are typically expected.
func Marshal ¶ added in v0.5.1
Marshal marshals v into a map[string]interface{}.
func Unmarshal ¶
Unmarshal unmarshals the data from src into the value pointed to by dst.
func UnmarshalerHookFunc ¶
func UnmarshalerHookFunc() mapstructure.DecodeHookFunc
UnmarshalerHookFunc returns a mapstructure.DecodeHookFunc that lets destination types that implement the Unmarshaler interface decode themselves.
Types ¶
type DecoderConfigOption ¶
type DecoderConfigOption = viper.DecoderConfigOption
A DecoderConfigOption modifies a mapstructure.DecoderConfig.
func ReplaceDecodeHook ¶ added in v0.5.1
func ReplaceDecodeHook(hook ...mapstructure.DecodeHookFunc) DecoderConfigOption
ReplaceDecodeHook creates a DecoderConfigOption that replaces the existing decode hooks on the DecoderConfig.
func WithDecodeHook ¶ added in v0.5.1
func WithDecodeHook(hook ...mapstructure.DecodeHookFunc) DecoderConfigOption
WithDecodeHook creates a DecoderConfigOption that attaches appends to the existing hooks on the DecoderConfig.
func WithTagName ¶
func WithTagName(name string) DecoderConfigOption
WithTagName configures a mapstructure.Decoder to use struct tags named name.