diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 59 |
1 files changed, 1 insertions, 58 deletions
@@ -20,61 +20,4 @@ func Query(json string, query string) (*model.Node, error) func QueryArray(json string, query []string) (*model.Node, error) ``` -## Node methods - -```go -package model // import "go.neonxp.dev/json/model" - -// Node of JSON tree -type Node struct { - Type NodeType -} - -// NewNode creates new node from value -func NewNode(value any) *Node - -// Get node from object by key -func (n *Node) Get(key string) (*Node, error) - -// Index returns node by index from array -func (n *Node) Index(idx int) (*Node, error) - -// Set node to object by key -func (n *Node) Set(key string, value *Node) error - -// SetIndex sets node to array by index -func (n *Node) SetIndex(idx int, value *Node) error - -// SetValue to node -func (n *Node) SetValue(value any) - -// Map callback to each key value pair of object -func (n *Node) Map(cb func(key string, value *Node) (*Node, error)) error - -// Each applies callback to each element of array -func (n *Node) Each(cb func(idx int, value *Node) error) error - -// Query returns node by array query -func (n *Node) Query(query []string) (*Node, error) - -// Value returns value of node -func (n *Node) Value() any - -// MarshalJSON to []byte -func (n *Node) MarshalJSON() ([]byte, error) - -// Merge two object or array nodes -func (n *Node) Merge(node *Node) error - -// Len returns length of object or array nodes -func (n *Node) Len() (int, error) - -// Compare current node with another node -func (n *Node) Compare(op Operand, node *Node) bool - -// Remove by key from object -func (n *Node) Remove(key string) error - -// RemoveIndex from array -func (n *Node) RemoveIndex(idx int) error -``` +Other methods: https://pkg.go.dev/go.neonxp.dev/json
\ No newline at end of file |