Documentation ¶
Index ¶
- type Key
- type MapTraverser
- func (t MapTraverser) Child(keys ...string) MapTraverser
- func (t MapTraverser) Delete(key string) bool
- func (t MapTraverser) FindAllWithKey(key string) MapTraversers
- func (t MapTraverser) Set(key string, i interface{}) bool
- func (t MapTraverser) SetAll(fn SetFunc) int
- func (t MapTraverser) Value(key string, i interface{}) (interface{}, bool)
- type MapTraversers
- type SetFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶ added in v1.2.0
type Key struct {
// contains filtered or unexported fields
}
Key represents either the index of an array (int) or the key in a map (string).
type MapTraverser ¶
type MapTraverser struct {
// contains filtered or unexported fields
}
func NewMapTraverser ¶
func NewMapTraverser(m map[string]interface{}) MapTraverser
func (MapTraverser) Child ¶
func (t MapTraverser) Child(keys ...string) MapTraverser
func (MapTraverser) Delete ¶
func (t MapTraverser) Delete(key string) bool
func (MapTraverser) FindAllWithKey ¶
func (t MapTraverser) FindAllWithKey(key string) MapTraversers
func (MapTraverser) Set ¶
func (t MapTraverser) Set(key string, i interface{}) bool
func (MapTraverser) SetAll ¶ added in v1.2.0
func (t MapTraverser) SetAll(fn SetFunc) int
SetAll traverses all []interface{} and map[string]interface{} types and calls the fn (SetFunc) for each key/value pair. If the SetFunc for a given key/value pair returns bool(true) as its 2nd return value, then said value will be updated to whatever SetFunc returned as the interface{}.
func (MapTraverser) Value ¶
func (t MapTraverser) Value(key string, i interface{}) (interface{}, bool)
type MapTraversers ¶
type MapTraversers []MapTraverser
Click to show internal directories.
Click to hide internal directories.