Documentation ¶
Overview ¶
Package mapping provides utilities for accessing generic maps with string keys, e.g. created by parsing a YAML or JSON string, message payloads, or fields in logging or testing messages.
Index ¶
- func MapIterator(data []interface{}) (func() bool, func() Map)
- func StrIterator(data []interface{}) (func() bool, func() string)
- type Changes
- type Map
- func (old Map) Compare(new Map) Changes
- func (m Map) Delete(key string)
- func (m Map) DeleteSpecial(prefix string)
- func (m Map) GetIntDef(key string, def int) int
- func (m Map) GetList(key string) []interface{}
- func (m Map) GetMap(key string) Map
- func (m Map) GetStr(key string) string
- func (m Map) GetStrDef(key, def string) string
- func (m Map) GetStrDefGlob(key, def string) string
- func (m Map) GetStrDefGlob1(key, def string) string
- func (m Map) GetStrDefGlob2(key, keyglob, def string) string
- func (m Map) GetStrList(key string) (r []string)
- func (m Map) IterateMap(key string, fct func(Map))
- func (m Map) IterateMapDef(key string, def Map, fct func(Map))
- func (m Map) IterateStr(key string, fct func(string))
- type Vars
- type VarsMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapIterator ¶
func StrIterator ¶
Types ¶
type Map ¶
type Map map[string]interface{}
func (Map) Compare ¶ added in v0.1.15
Compare compares `new` and `old` and returns a mapping of changed, added, or removed items.
func (Map) DeleteSpecial ¶ added in v0.1.19
func (Map) GetStrDefGlob ¶
GetStrDefGlob: If key not found return default. If found expand global variable reference ($$...$$) in value.
func (Map) GetStrDefGlob1 ¶
GetStrDefGlob1: If key not found try to look it up in global vars. If found expand global variable reference in value.
func (Map) GetStrDefGlob2 ¶
GetStrDefGlob2: If key not found try to look it up in global vars using the special key given as second parameter. If found expand global variable reference in value.