Versions in this module Expand all Collapse all v1 v1.3.6 Aug 10, 2022 Changes in this version + const V_ANY + const V_ARRAY + const V_ERROR + const V_FALSE + const V_NONE + const V_NULL + const V_NUMBER + const V_OBJECT + const V_STRING + const V_TRUE + var ErrNotExist error = newError(_ERR_NOT_FOUND, "value not exists") + var ErrUnsupportType error = newError(_ERR_UNSUPPORT_TYPE, "unsupported type") + func Loads(src string) (int, interface{}, error) + func LoadsUseNumber(src string) (int, interface{}, error) + type Iterator struct + func (self *Iterator) HasNext() bool + func (self *Iterator) Len() int + func (self *Iterator) Pos() int + type ListIterator struct + func (self *ListIterator) Next(v *Node) bool + type Node struct + func NewAny(any interface{}) Node + func NewArray(v []Node) Node + func NewBool(v bool) Node + func NewBytes(src []byte) Node + func NewNull() Node + func NewNumber(v string) Node + func NewObject(v []Pair) Node + func NewRaw(json string) Node + func NewString(v string) Node + func (self *Node) Add(node Node) error + func (self *Node) AddAny(val interface{}) error + func (self *Node) Array() ([]interface{}, error) + func (self *Node) ArrayUseNode() ([]Node, error) + func (self *Node) ArrayUseNumber() ([]interface{}, error) + func (self *Node) Bool() (bool, error) + func (self *Node) Cap() (int, error) + func (self *Node) Check() error + func (self *Node) Exists() bool + func (self *Node) Float64() (float64, error) + func (self *Node) ForEach(sc Scanner) error + func (self *Node) Get(key string) *Node + func (self *Node) GetByPath(path ...interface{}) *Node + func (self *Node) Index(idx int) *Node + func (self *Node) IndexOrGet(idx int, key string) *Node + func (self *Node) IndexPair(idx int) *Pair + func (self *Node) Int64() (int64, error) + func (self *Node) Interface() (interface{}, error) + func (self *Node) InterfaceUseNode() (interface{}, error) + func (self *Node) InterfaceUseNumber() (interface{}, error) + func (self *Node) Len() (int, error) + func (self *Node) Load() error + func (self *Node) LoadAll() error + func (self *Node) Map() (map[string]interface{}, error) + func (self *Node) MapUseNode() (map[string]Node, error) + func (self *Node) MapUseNumber() (map[string]interface{}, error) + func (self *Node) MarshalJSON() ([]byte, error) + func (self *Node) Number() (json.Number, error) + func (self *Node) Properties() (ObjectIterator, error) + func (self *Node) Raw() (string, error) + func (self *Node) Set(key string, node Node) (bool, error) + func (self *Node) SetAny(key string, val interface{}) (bool, error) + func (self *Node) SetAnyByIndex(index int, val interface{}) (bool, error) + func (self *Node) SetByIndex(index int, node Node) (bool, error) + func (self *Node) SortKeys(recurse bool) (err error) + func (self *Node) StrictFloat64() (float64, error) + func (self *Node) StrictInt64() (int64, error) + func (self *Node) StrictNumber() (json.Number, error) + func (self *Node) StrictString() (string, error) + func (self *Node) String() (string, error) + func (self *Node) UnmarshalJSON(data []byte) (err error) + func (self *Node) UnsafeArray() ([]Node, error) + func (self *Node) UnsafeMap() ([]Pair, error) + func (self *Node) Unset(key string) (bool, error) + func (self *Node) UnsetByIndex(index int) (bool, error) + func (self *Node) Valid() bool + func (self *Node) Values() (ListIterator, error) + func (self Node) Error() string + func (self Node) IsRaw() bool + func (self Node) Type() int + type ObjectIterator struct + func (self *ObjectIterator) Next(p *Pair) bool + type Pair struct + Key string + Value Node + type PairSlice []Pair + func (self PairSlice) Sort() + type Parser struct + func NewParser(src string) *Parser + func (self *Parser) ExportError(err types.ParsingError) error + func (self *Parser) Parse() (Node, types.ParsingError) + func (self *Parser) Pos() int + type Scanner func(path Sequence, node *Node) bool + type Searcher struct + func NewSearcher(str string) *Searcher + func (self *Searcher) GetByPath(path ...interface{}) (Node, error) + type Sequence struct + Index int + Key *string + func (s Sequence) String() string