Documentation ¶
Index ¶
- Variables
- func DeepCopyJSONValue(x interface{}) interface{}
- func NestedBool(obj *OrderedMap, fields ...string) (bool, bool, error)
- func NestedFieldCopy(obj *OrderedMap, fields ...string) (interface{}, bool, error)
- func NestedFieldNoCopy(obj *OrderedMap, fields ...string) (interface{}, bool, error)
- func NestedFloat64(obj *OrderedMap, fields ...string) (float64, bool, error)
- func NestedInt64(obj *OrderedMap, fields ...string) (int64, bool, error)
- func NestedSlice(obj *OrderedMap, fields ...string) ([]interface{}, bool, error)
- func NestedString(obj *OrderedMap, fields ...string) (string, bool, error)
- func NestedStringMap(obj *OrderedMap, fields ...string) (map[string]string, bool, error)
- func NestedStringSlice(obj *OrderedMap, fields ...string) ([]string, bool, error)
- func RemoveNestedField(obj *OrderedMap, fields ...string)
- func SetNestedField(obj *OrderedMap, value interface{}, fields ...string) error
- func SetNestedMap(obj *OrderedMap, value OrderedMap, fields ...string) error
- func SetNestedSlice(obj *OrderedMap, value []interface{}, fields ...string) error
- func SetNestedStringMap(obj *OrderedMap, value map[string]string, fields ...string) error
- func SetNestedStringSlice(obj *OrderedMap, value []string, fields ...string) error
- type ByIndex
- type ByPair
- type KeyIndex
- type OrderedMap
- func (o *OrderedMap) DeepCopy() *OrderedMap
- func (o *OrderedMap) DeepCopyInto(out *OrderedMap)
- func (o *OrderedMap) Delete(key string)
- func (o *OrderedMap) Entry(key string) interface{}
- func (o *OrderedMap) Get(key string) (interface{}, bool)
- func (o *OrderedMap) IsZero() bool
- 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) Sort(lessFunc func(a *Pair, b *Pair) bool)
- func (o *OrderedMap) SortKeys(sortFunc func(keys []string))
- func (o *OrderedMap) UnmarshalJSON(b []byte) error
- type Pair
Constants ¶
This section is empty.
Variables ¶
var NoValueError = errors.New("No value for this key")
Functions ¶
func DeepCopyJSONValue ¶
func DeepCopyJSONValue(x interface{}) interface{}
DeepCopyJSONValue deep copies the passed value, assuming it is a valid JSON representation i.e. only contains types produced by json.Unmarshal() and also int64. bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number and nil
func NestedBool ¶
func NestedBool(obj *OrderedMap, fields ...string) (bool, bool, error)
NestedBool returns the bool value of a nested field. Returns false if value is not found and an error if not a bool.
func NestedFieldCopy ¶
func NestedFieldCopy(obj *OrderedMap, fields ...string) (interface{}, bool, error)
NestedFieldCopy returns a deep copy of the value of a nested field. Returns false if the value is missing. No error is returned for a nil field.
Note: fields passed to this function are treated as keys within the passed object; no array/slice syntax is supported.
func NestedFieldNoCopy ¶
func NestedFieldNoCopy(obj *OrderedMap, fields ...string) (interface{}, bool, error)
NestedFieldNoCopy returns a reference to a nested field. Returns false if value is not found and an error if unable to traverse obj.
Note: fields passed to this function are treated as keys within the passed object; no array/slice syntax is supported.
func NestedFloat64 ¶
func NestedFloat64(obj *OrderedMap, fields ...string) (float64, bool, error)
NestedFloat64 returns the float64 value of a nested field. Returns false if value is not found and an error if not a float64.
func NestedInt64 ¶
func NestedInt64(obj *OrderedMap, fields ...string) (int64, bool, error)
NestedInt64 returns the int64 value of a nested field. Returns false if value is not found and an error if not an int64.
func NestedSlice ¶
func NestedSlice(obj *OrderedMap, fields ...string) ([]interface{}, bool, error)
NestedSlice returns a deep copy of []interface{} value of a nested field. Returns false if value is not found and an error if not a []interface{}.
func NestedString ¶
func NestedString(obj *OrderedMap, fields ...string) (string, bool, error)
NestedString returns the string value of a nested field. Returns false if value is not found and an error if not a string.
func NestedStringMap ¶
NestedStringMap returns a copy of map[string]string value of a nested field. Returns false if value is not found and an error if not a OrderedMap or contains non-string values in the map.
func NestedStringSlice ¶
func NestedStringSlice(obj *OrderedMap, fields ...string) ([]string, bool, error)
NestedStringSlice returns a copy of []string value of a nested field. Returns false if value is not found and an error if not a []interface{} or contains non-string items in the slice.
func RemoveNestedField ¶
func RemoveNestedField(obj *OrderedMap, fields ...string)
RemoveNestedField removes the nested field from the obj.
func SetNestedField ¶
func SetNestedField(obj *OrderedMap, value interface{}, fields ...string) error
SetNestedField sets the value of a nested field to a deep copy of the value provided. Returns an error if value cannot be set because one of the nesting levels is not a OrderedMap.
func SetNestedMap ¶
func SetNestedMap(obj *OrderedMap, value OrderedMap, fields ...string) error
SetNestedMap sets the OrderedMap value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a OrderedMap.
func SetNestedSlice ¶
func SetNestedSlice(obj *OrderedMap, value []interface{}, fields ...string) error
SetNestedSlice sets the slice value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a OrderedMap.
func SetNestedStringMap ¶
func SetNestedStringMap(obj *OrderedMap, value map[string]string, fields ...string) error
SetNestedStringMap sets the map[string]string value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a OrderedMap.
func SetNestedStringSlice ¶
func SetNestedStringSlice(obj *OrderedMap, value []string, fields ...string) error
SetNestedStringSlice sets the string slice value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a OrderedMap.
Types ¶
type OrderedMap ¶
type OrderedMap struct {
// contains filtered or unexported fields
}
func DeepCopyJSON ¶
func DeepCopyJSON(x *OrderedMap) *OrderedMap
DeepCopyJSON deep copies the passed value, assuming it is a valid JSON representation i.e. only contains types produced by json.Unmarshal() and also int64. bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number and nil
func NestedMap ¶
func NestedMap(obj *OrderedMap, fields ...string) (*OrderedMap, bool, error)
NestedMap returns a deep copy of OrderedMap value of a nested field. Returns false if value is not found and an error if not a OrderedMap.
func New ¶
func New() *OrderedMap
func (*OrderedMap) DeepCopy ¶
func (o *OrderedMap) DeepCopy() *OrderedMap
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrderedMap.
func (*OrderedMap) DeepCopyInto ¶
func (o *OrderedMap) DeepCopyInto(out *OrderedMap)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*OrderedMap) Delete ¶
func (o *OrderedMap) Delete(key string)
func (*OrderedMap) Entry ¶
func (o *OrderedMap) Entry(key string) interface{}
func (*OrderedMap) Get ¶
func (o *OrderedMap) Get(key string) (interface{}, bool)
func (*OrderedMap) IsZero ¶
func (o *OrderedMap) IsZero() bool
IsZero returns true if the value is nil or OrderedMap is zero.
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) 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) UnmarshalJSON ¶
func (o *OrderedMap) UnmarshalJSON(b []byte) error