Documentation
¶
Overview ¶
Package conf contains alias for map encoded configuration and structure unmarshaller
Index ¶
Constants ¶
const TagName = "cfg"
TagName is a tag name, used for decoder customization
Variables ¶
var ErrNilConfigMap = errors.New("unable to process nil map")
ErrNilConfigMap returned if unmarshalling map is nil and could not be decoded into structure
Functions ¶
This section is empty.
Types ¶
type MapConfig ¶
MapConfig is just alias for map[string]any
func (MapConfig) MarshalZerologObject ¶
MarshalZerologObject writes map into zerolog event
func (MapConfig) Unmarshal ¶
Unmarshal decodes receiver map into provided structure. Decoder configured to automatically unmarshal inherited structures, convert string-ed duration (1s, 2m, 3h...) into time.Duration and string representation IP into net.IP. Tag used for decode customization is conf.TagName.
type NamedMapConfig ¶ added in v0.0.3
NamedMapConfig encapsulates MapConfig with string Name
func (NamedMapConfig) MarshalZerologObject ¶ added in v0.0.3
func (nm NamedMapConfig) MarshalZerologObject(e *zerolog.Event)
MarshalZerologObject writes Name and Config into zerolog event