config

package
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeInto

func DecodeInto(dst interface{}, src interface{}, opts ...mapdecode.Option) error

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

func (m AttributeMap) Get(name string, dst interface{}, opts ...mapdecode.Option) (bool, error)

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

func (m AttributeMap) Pop(name string, dst interface{}, opts ...mapdecode.Option) (bool, error)

Pop removes the named key from the AttributeMap and decodes the value into the dst interface.

func (AttributeMap) PopBool

func (m AttributeMap) PopBool(name string) (bool, error)

PopBool will pop a value from the attribute map and return the bool it points to, or an error if it couldn't pop the value and decode.

func (AttributeMap) PopString

func (m AttributeMap) PopString(name string) (string, error)

PopString will pop a value from the attribute map and return the string it points to, or an error if it couldn't pop the value and decode.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL