Documentation ¶
Overview ¶
Package json implements encoding and decoding of JSON.
Index ¶
- func Marshal(v interface{}) ([]byte, error)
- func Unmarshal(b []byte, v interface{}) error
- type Boolean
- type Decoder
- type Encoder
- type Node
- func (n *Node) Bytes() []byte
- func (n *Node) Error() error
- func (n *Node) Get(key string) *Node
- func (n *Node) GetN(i int) *Node
- func (n *Node) Int() int
- func (n *Node) IsArray() bool
- func (n *Node) IsBool() bool
- func (n *Node) IsEmpty() bool
- func (n *Node) IsNull() bool
- func (n *Node) IsNumber() bool
- func (n *Node) IsObject() bool
- func (n *Node) IsString() bool
- func (n *Node) IsValid() bool
- func (n *Node) Keys() []string
- func (n *Node) Len() int
- func (n *Node) SortedKeys() []string
- func (n *Node) String() string
- func (n *Node) Type() lzjson.Type
- func (n *Node) Unmarshal(v interface{}) error
- type Number
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Boolean ¶
type Boolean struct {
B bool
}
func (Boolean) MarshalJSON ¶
func (*Boolean) UnmarshalJSON ¶
type Decoder ¶
A Decoder reads and decodes JSON values from an input stream.
func NewDecoder ¶
NewDecoder returns a new decoder that reads from r.
type Encoder ¶
An Encoder writes JSON values to an output stream.
func NewEncoder ¶
NewEncoder returns a new encoder that writes to w.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is an interface for all JSON nodes.
func (*Node) GetN ¶
GetN gets array's inner value. Only works with Array value type. 0 for the first item.
func (*Node) SortedKeys ¶
SortedKeys gets an array object's keys in alphabetical order
type Number ¶ added in v1.15.0
func (Number) MarshalJSON ¶ added in v1.15.0
func (*Number) UnmarshalJSON ¶ added in v1.15.0
Click to show internal directories.
Click to hide internal directories.