mapnode

package
v0.0.0-...-320551d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MapnodeVersion = "0.0.2"

Variables

This section is empty.

Functions

func GetValueByLongKey

func GetValueByLongKey(m map[string]interface{}, longKey string) (interface{}, error)

func SplitCommaSeparatedKeys

func SplitCommaSeparatedKeys(key string) []string

Types

type DiffResult

type DiffResult struct {
	Items []Difference `json:"items"`
}

func FindDiffBetweenNodes

func FindDiffBetweenNodes(t1, t2 *Node, findType map[string]bool) *DiffResult

func (*DiffResult) Filter

func (dr *DiffResult) Filter(maskKeys []string) (*DiffResult, *DiffResult, []string)

func (*DiffResult) Keys

func (d *DiffResult) Keys() []string

func (*DiffResult) Size

func (dr *DiffResult) Size() int

func (*DiffResult) String

func (d *DiffResult) String() string

func (*DiffResult) ToJson

func (d *DiffResult) ToJson() string

func (*DiffResult) Values

func (d *DiffResult) Values() []map[string]interface{}

type Difference

type Difference struct {
	Key    string                 `json:"key"`
	Values map[string]interface{} `json:"values"`
}

type Node

type Node struct {
	Value    *NodeValue
	Children interface{}
}

func NewFromBytes

func NewFromBytes(rawObj []byte) (*Node, error)

func NewFromInterfaceBytes

func NewFromInterfaceBytes(rawObj []byte) (*Node, error)

func NewFromMap

func NewFromMap(objMap map[string]interface{}) (*Node, error)

func NewFromYamlBytes

func NewFromYamlBytes(rawObj []byte) (*Node, error)

func NewNode

func NewNode(val interface{}) *Node

func (*Node) Copy

func (n *Node) Copy() *Node

func (*Node) DeepCopyInto

func (n *Node) DeepCopyInto(n2 *Node)

func (*Node) Diff

func (t *Node) Diff(t2 *Node) *DiffResult

func (*Node) DiffSpecificType

func (t *Node) DiffSpecificType(t2 *Node, findTypeList []string) *DiffResult

func (*Node) Filter

func (n *Node) Filter(filterKeys []string) *Node

func (*Node) FindUpdatedAndCreated

func (t *Node) FindUpdatedAndCreated(t2 *Node) *DiffResult

func (*Node) FindUpdatedAndDeleted

func (t *Node) FindUpdatedAndDeleted(t2 *Node) *DiffResult

func (*Node) Get

func (t *Node) Get(concatKey string) (interface{}, bool)

func (*Node) GetBool

func (t *Node) GetBool(concatKey string, defaultValue bool) bool

func (*Node) GetChild

func (n *Node) GetChild(key string) (*Node, bool)

func (*Node) GetChildrenMap

func (n *Node) GetChildrenMap() map[string]*Node

func (*Node) GetChildrenSlice

func (n *Node) GetChildrenSlice() []*Node

func (*Node) GetNode

func (t *Node) GetNode(concatKey string) (*Node, bool)

func (*Node) GetNodeByJSONPath

func (n *Node) GetNodeByJSONPath(jpathKey string) (*Node, bool)

func (*Node) GetString

func (t *Node) GetString(concatKey string) string

func (*Node) Interface

func (n *Node) Interface() interface{}

func (*Node) IsMap

func (n *Node) IsMap() bool

func (*Node) IsSlice

func (n *Node) IsSlice() bool

func (*Node) IsValue

func (n *Node) IsValue() bool

func (*Node) KeyExists

func (n *Node) KeyExists(concatKey string) bool

func (*Node) Mask

func (t *Node) Mask(keys []string) *Node

func (*Node) Merge

func (n *Node) Merge(n2 *Node) (*Node, error)

func (*Node) MultipleSubNode

func (t *Node) MultipleSubNode(concatKey string) []*Node

func (*Node) Ravel

func (t *Node) Ravel() map[string]interface{}

func (*Node) Size

func (n *Node) Size() int

func (*Node) String

func (n *Node) String() string

func (*Node) SubNode

func (t *Node) SubNode(concatKey string) *Node

func (*Node) ToJson

func (n *Node) ToJson() string

func (*Node) ToMap

func (t *Node) ToMap() map[string]interface{}

func (*Node) ToYaml

func (n *Node) ToYaml() string

type NodeValue

type NodeValue struct {
	Type  reflect.Type
	Value interface{}
}

func NewNodeValue

func NewNodeValue(val interface{}) *NodeValue

func (*NodeValue) Interface

func (nv *NodeValue) Interface() interface{}

func (*NodeValue) String

func (nv *NodeValue) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL