Documentation ¶
Overview ¶
Package orderedmap is modified version of: https://github.com/iancoleman/orderedmap
Index ¶
- type ByPair
- type Key
- type MapStep
- type OrderedMap
- func (o *OrderedMap) Clone() *OrderedMap
- func (o *OrderedMap) DeepCopy(callback deepcopy.TranslateFunc, steps deepcopy.Steps, ...) *OrderedMap
- func (o *OrderedMap) Delete(key string)
- func (o *OrderedMap) Get(key string) (interface{}, bool)
- func (o *OrderedMap) GetNested(keysStr string) (value interface{}, found bool, err error)
- func (o *OrderedMap) GetNestedMap(keysStr string) (m *OrderedMap, found bool, err error)
- func (o *OrderedMap) GetNestedOrNil(keysStr string) interface{}
- func (o *OrderedMap) GetNestedPath(keys Key) (value interface{}, found bool, err error)
- func (o *OrderedMap) GetNestedPathMap(keys Key) (m *OrderedMap, found bool, err error)
- func (o *OrderedMap) GetNestedPathOrNil(keys Key) interface{}
- func (o *OrderedMap) GetOrNil(key string) interface{}
- func (o *OrderedMap) Keys() []string
- func (o *OrderedMap) Len() int
- func (o OrderedMap) MarshalJSON() ([]byte, error)
- func (o *OrderedMap) Set(key string, value interface{})
- func (o *OrderedMap) SetNested(keysStr string, value interface{}) error
- func (o *OrderedMap) SetNestedPath(keys Key, value interface{}) error
- func (o *OrderedMap) Sort(lessFunc func(a *Pair, b *Pair) bool)
- func (o *OrderedMap) SortKeys(sortFunc func(keys []string))
- func (o *OrderedMap) ToMap() map[string]interface{}
- func (o *OrderedMap) UnmarshalJSON(b []byte) error
- func (o *OrderedMap) VisitAllRecursive(callback visitCallback)
- type Pair
- type SliceStep
- type Step
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key []Step
KeyPath - path to a value in the OrderedMap (JSON file).
func KeyFromStr ¶
func (Key) WithoutFirst ¶
func (Key) WithoutLast ¶
type OrderedMap ¶
type OrderedMap struct {
// contains filtered or unexported fields
}
func FromPairs ¶
func FromPairs(pairs []Pair) *OrderedMap
func New ¶
func New() *OrderedMap
func (*OrderedMap) Clone ¶
func (o *OrderedMap) Clone() *OrderedMap
func (*OrderedMap) DeepCopy ¶
func (o *OrderedMap) DeepCopy(callback deepcopy.TranslateFunc, steps deepcopy.Steps, visited deepcopy.VisitedMap) *OrderedMap
func (*OrderedMap) Delete ¶
func (o *OrderedMap) Delete(key string)
func (*OrderedMap) Get ¶
func (o *OrderedMap) Get(key string) (interface{}, bool)
func (*OrderedMap) GetNested ¶
func (o *OrderedMap) GetNested(keysStr string) (value interface{}, found bool, err error)
func (*OrderedMap) GetNestedMap ¶
func (o *OrderedMap) GetNestedMap(keysStr string) (m *OrderedMap, found bool, err error)
func (*OrderedMap) GetNestedOrNil ¶
func (o *OrderedMap) GetNestedOrNil(keysStr string) interface{}
GetNestedOrNil returns nil if values is not found or an error occurred.
func (*OrderedMap) GetNestedPath ¶
func (o *OrderedMap) GetNestedPath(keys Key) (value interface{}, found bool, err error)
func (*OrderedMap) GetNestedPathMap ¶
func (o *OrderedMap) GetNestedPathMap(keys Key) (m *OrderedMap, found bool, err error)
func (*OrderedMap) GetNestedPathOrNil ¶
func (o *OrderedMap) GetNestedPathOrNil(keys Key) interface{}
GetNestedPathOrNil returns nil if values is not found or an error occurred.
func (*OrderedMap) GetOrNil ¶
func (o *OrderedMap) GetOrNil(key string) interface{}
func (*OrderedMap) Keys ¶
func (o *OrderedMap) Keys() []string
func (*OrderedMap) Len ¶
func (o *OrderedMap) Len() int
func (OrderedMap) MarshalJSON ¶
func (o OrderedMap) MarshalJSON() ([]byte, error)
func (*OrderedMap) Set ¶
func (o *OrderedMap) Set(key string, value interface{})
func (*OrderedMap) SetNested ¶
func (o *OrderedMap) SetNested(keysStr string, value interface{}) error
SetNested value defined by key, eg. "parameters.foo[123]".
func (*OrderedMap) SetNestedPath ¶
func (o *OrderedMap) SetNestedPath(keys Key, value interface{}) error
SetNestedPath value defined by key, eg. Key{MapStep("parameters), MapStep("foo"), SliceStep(123)}.
func (*OrderedMap) Sort ¶
func (o *OrderedMap) Sort(lessFunc func(a *Pair, b *Pair) bool)
Sort Sort the map using your sort func.
func (*OrderedMap) SortKeys ¶
func (o *OrderedMap) SortKeys(sortFunc func(keys []string))
SortKeys Sort the map keys using your sort func.
func (*OrderedMap) ToMap ¶
func (o *OrderedMap) ToMap() map[string]interface{}
func (*OrderedMap) UnmarshalJSON ¶
func (o *OrderedMap) UnmarshalJSON(b []byte) error
func (*OrderedMap) VisitAllRecursive ¶
func (o *OrderedMap) VisitAllRecursive(callback visitCallback)
VisitAllRecursive calls callback for each nested key in OrderedMap or []interface{}.
Click to show internal directories.
Click to hide internal directories.