Documentation ¶
Index ¶
- func GetNestedParam(keyStr, separator string, candidates ...map[string]interface{}) (interface{}, error)
- func GetNestedParamFn(keyStr, separator string, lookupFn func(key string) interface{}) (interface{}, string, map[string]interface{}, error)
- func GetString(m map[string]interface{}, key string) string
- func ToLower(m map[string]interface{})
- type KeyRenamer
- type Scratch
- func (c *Scratch) Add(key string, newAddend interface{}) (string, error)
- func (c *Scratch) Delete(key string) string
- func (c *Scratch) Get(key string) interface{}
- func (c *Scratch) GetSortedMapValues(key string) interface{}
- func (c *Scratch) Set(key string, value interface{}) string
- func (c *Scratch) SetInMap(key string, mapKey string, value interface{}) string
- type Scratcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNestedParam ¶ added in v0.56.0
func GetNestedParam(keyStr, separator string, candidates ...map[string]interface{}) (interface{}, error)
GetNestedParam gets the first match of the keyStr in the candidates given. It will first try the exact match and then try to find it as a nested map value, using the given separator, e.g. "mymap.name". It assumes that all the maps given have lower cased keys.
func GetNestedParamFn ¶ added in v0.56.0
Types ¶
type KeyRenamer ¶ added in v0.54.0
type KeyRenamer struct {
// contains filtered or unexported fields
}
KeyRenamer supports renaming of keys in a map.
func NewKeyRenamer ¶ added in v0.54.0
func NewKeyRenamer(patternKeys ...string) (KeyRenamer, error)
NewKeyRenamer creates a new KeyRenamer given a list of pattern and new key value pairs.
func (KeyRenamer) Rename ¶ added in v0.54.0
func (r KeyRenamer) Rename(m map[string]interface{})
Rename renames the keys in the given map according to the patterns in the current KeyRenamer.
type Scratch ¶ added in v0.45.1
type Scratch struct {
// contains filtered or unexported fields
}
Scratch is a writable context used for stateful operations in Page/Node rendering.
func NewScratch ¶ added in v0.45.1
func NewScratch() *Scratch
NewScratch returns a new instance Scratch.
func (*Scratch) Add ¶ added in v0.45.1
Add will, for single values, add (using the + operator) the addend to the existing addend (if found). Supports numeric values and strings.
If the first add for a key is an array or slice, then the next value(s) will be appended.
func (*Scratch) GetSortedMapValues ¶ added in v0.45.1
GetSortedMapValues returns a sorted map previously filled with SetInMap.