Documentation ¶
Index ¶
- func DecodeInto(dst interface{}, src interface{}, opts ...mapdecode.Option) error
- func InterpolateWith(resolver interpolate.VariableResolver) mapdecode.Option
- type AttributeMap
- func (m AttributeMap) Decode(dst interface{}, opts ...mapdecode.Option) error
- func (m AttributeMap) Get(name string, dst interface{}, opts ...mapdecode.Option) (bool, error)
- func (m AttributeMap) Keys() []string
- func (m AttributeMap) Pop(name string, dst interface{}, opts ...mapdecode.Option) (bool, error)
- func (m AttributeMap) PopBool(name string) (bool, error)
- func (m AttributeMap) PopString(name string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeInto ¶
DecodeInto will decode the src's data into the dst interface.
func InterpolateWith ¶
func InterpolateWith(resolver interpolate.VariableResolver) mapdecode.Option
InterpolateWith is a MapDecode option that will read a structField's tag information, and if the `interpolate` option is set, it will use the interpolate resolver to alter data as it's being decoded into the struct.
Types ¶
type AttributeMap ¶
type AttributeMap map[string]interface{}
AttributeMap is a convenience type on top of a map that gives us a cleaner interface to validate config values.
func (AttributeMap) Decode ¶
func (m AttributeMap) Decode(dst interface{}, opts ...mapdecode.Option) error
Decode attempts to decode the AttributeMap into the dst interface.
func (AttributeMap) Get ¶
Get grabs a value from the attribute map and decodes it into the dst interface.
func (AttributeMap) Keys ¶
func (m AttributeMap) Keys() []string
Keys returns all the keys of the attribute map.
func (AttributeMap) Pop ¶
Pop removes the named key from the AttributeMap and decodes the value into the dst interface.