Documentation ¶
Index ¶
- type Children
- type ListNode
- func (l *ListNode) Assign(child Node, _ bool) error
- func (b ListNode) Child(id NodeId) (Node, error)
- func (b ListNode) Children() Children
- func (l *ListNode) Clone() (Node, error)
- func (l *ListNode) DeepClone() (Node, error)
- func (l *ListNode) Delete(id NodeId) error
- func (l *ListNode) Deserialize(bytes []byte) error
- func (b ListNode) FetchChild(idList []NodeId) (Node, error)
- func (b ListNode) Id() NodeId
- func (l *ListNode) InsertAfter(id NodeId, child Node) error
- func (l *ListNode) InsertAtHead(child Node) error
- func (b ListNode) IsTombStone() bool
- func (b ListNode) ListIndex() int
- func (b ListNode) MarkTombstone() error
- func (l *ListNode) Serialize() ([]byte, error)
- func (b ListNode) SetId(id NodeId) error
- func (b ListNode) SetListIndex(idx int) error
- type MapNode
- func (b MapNode) Assign(node Node, override bool) error
- func (b MapNode) Child(id NodeId) (Node, error)
- func (b MapNode) Children() Children
- func (m *MapNode) Clone() (Node, error)
- func (m *MapNode) DeepClone() (Node, error)
- func (m *MapNode) Delete(id NodeId) error
- func (m *MapNode) Deserialize(bytes []byte) error
- func (b MapNode) FetchChild(idList []NodeId) (Node, error)
- func (b MapNode) Id() NodeId
- func (b MapNode) IsTombStone() bool
- func (b MapNode) ListIndex() int
- func (b MapNode) MarkTombstone() error
- func (m *MapNode) Serialize() ([]byte, error)
- func (b MapNode) SetId(id NodeId) error
- func (b MapNode) SetListIndex(idx int) error
- type Node
- type NodeId
- type RegisterNode
- func (b RegisterNode) Assign(node Node, override bool) error
- func (b RegisterNode) Child(id NodeId) (Node, error)
- func (r *RegisterNode) Children() Children
- func (r *RegisterNode) Clone() (Node, error)
- func (r *RegisterNode) DeepClone() (Node, error)
- func (r *RegisterNode) Delete(NodeId) error
- func (r *RegisterNode) Deserialize(bytes []byte) error
- func (r *RegisterNode) FetchChild([]NodeId) (Node, error)
- func (b RegisterNode) Id() NodeId
- func (b RegisterNode) IsTombStone() bool
- func (b RegisterNode) ListIndex() int
- func (b RegisterNode) MarkTombstone() error
- func (r *RegisterNode) Serialize() ([]byte, error)
- func (b RegisterNode) SetId(id NodeId) error
- func (b RegisterNode) SetListIndex(idx int) error
- func (r *RegisterNode) SetValue(val interface{})
- func (r *RegisterNode) Value() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListNode ¶
type ListNode struct {
// contains filtered or unexported fields
}
func NewListNode ¶
NewListNode returns a Node of type ListNode.
func (*ListNode) Deserialize ¶
func (ListNode) FetchChild ¶
func (*ListNode) InsertAtHead ¶
func (ListNode) IsTombStone ¶
func (b ListNode) IsTombStone() bool
func (ListNode) MarkTombstone ¶
func (b ListNode) MarkTombstone() error
func (ListNode) SetListIndex ¶
type MapNode ¶
type MapNode struct {
// contains filtered or unexported fields
}
func NewMapNode ¶
NewMapNode is an exported function used to create a Node of type MapNode.
func (*MapNode) Deserialize ¶
func (MapNode) FetchChild ¶
func (MapNode) IsTombStone ¶
func (b MapNode) IsTombStone() bool
func (MapNode) MarkTombstone ¶
func (b MapNode) MarkTombstone() error
func (MapNode) SetListIndex ¶
type Node ¶
type Node interface { // Id returns current Node id. Id() NodeId // SetId sets the node with the given id. SetId(NodeId) error // IsTombStone returns if the given node has already been marked as a tombstone. IsTombStone() bool // MarkTombstone marks the current node as a tombstone. MarkTombstone() error // Serialize and Deserialize aids to perform serialization and deserialization // of the subtree pointed by current node. Serialize() ([]byte, error) Deserialize([]byte) error // DeepClone performs a deepcopy and returns a copied subtree. DeepClone() (Node, error) // Clone copies just the node and not the subtree. Clone() (Node, error) // FetchChild returns the children node reachable through the given set of ids as path. // travserse the json tree in using []NodeId as a path FetchChild([]NodeId) (Node, error) // Child returns the children map of current node. Children() Children // Get returns child with Id if present and not marked as tombstone Child(NodeId) (Node, error) // Assign assigns argument node as a child of the current node. Assign(Node, bool) error // ListIndex is only valid if node is a child of a ListNode // Get listIndex for node ListIndex() int // SetListIndex sets the index value for the node SetListIndex(int) error // Delete marks the given id a tombstone. Delete(NodeId) error }
Node interface represents the overall primary operations of an JSON node.
type RegisterNode ¶
type RegisterNode struct {
// contains filtered or unexported fields
}
func NewRegisterNode ¶
func NewRegisterNode(id NodeId, value interface{}) *RegisterNode
NewRegisterNode returns a Node of type RegisterNode with given id and value.
func (*RegisterNode) Children ¶
func (r *RegisterNode) Children() Children
Child returns a nil object, as RegisterNode itself is a leaf node.
func (*RegisterNode) Clone ¶
func (r *RegisterNode) Clone() (Node, error)
DeepClone and Clone does the same thing here
func (*RegisterNode) DeepClone ¶
func (r *RegisterNode) DeepClone() (Node, error)
func (*RegisterNode) Delete ¶
func (r *RegisterNode) Delete(NodeId) error
func (*RegisterNode) Deserialize ¶
func (r *RegisterNode) Deserialize(bytes []byte) error
func (*RegisterNode) FetchChild ¶
func (r *RegisterNode) FetchChild([]NodeId) (Node, error)
FetchChild override. RegisterNode is always a leaf node.
func (RegisterNode) IsTombStone ¶
func (b RegisterNode) IsTombStone() bool
func (RegisterNode) MarkTombstone ¶
func (b RegisterNode) MarkTombstone() error
func (*RegisterNode) Serialize ¶
func (r *RegisterNode) Serialize() ([]byte, error)
func (RegisterNode) SetListIndex ¶
func (*RegisterNode) SetValue ¶
func (r *RegisterNode) SetValue(val interface{})
SetValue assigns the current node with the given value.
func (*RegisterNode) Value ¶
func (r *RegisterNode) Value() interface{}
Value returns the current RegisterNode value.
Click to show internal directories.
Click to hide internal directories.