Documentation ¶
Index ¶
- Variables
- func Marshal(node Node) (string, error)
- func MarshalEncode(node Node, output Encoder)
- func MarshalWrite(node Node, output Writer) error
- func UnmarshalDecode(_ Decoder) error
- type Accepted
- type Array
- type Builder
- type BuilderSonic
- type Castable
- type Container
- type Decoder
- type Encoder
- type EncoderBool
- type EncoderFloat
- type EncoderInt
- type EncoderRaw
- type EncoderString
- type EncoderUint
- type Indexed
- type Keyed
- type Marshaler
- type Node
- type Number
- type Object
- type Parented
- type Reader
- type Root
- type Value
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFinalized = errors.New("node is finalized, can't be edited") ErrNoOpenedArrayOrObject = errors.New("can't close object or array because there is no opened node") ErrMissingKey = errors.New("can't create value without key") ErrDoubleKey = errors.New("already have a key for next value") ErrUnusedKey = errors.New("key for value is unused") )
Functions ¶
func MarshalEncode ¶
func MarshalWrite ¶
func UnmarshalDecode ¶
Types ¶
type Array ¶
func NewArrayWithCapacity ¶
type Builder ¶
type Builder interface { AddKey(key string) error AddValue(val any) error AddKeyValue(key string, val any) error StartObject() error StartObjectWithCapacity(capacity int) error StartArray() error StartArrayWithCapacity(capacity int) error EndObjectOrArray() error Build() Root }
func NewBuilder ¶
func NewBuilder() Builder
type BuilderSonic ¶
type BuilderSonic interface { OnNull() error OnBool(v bool) error OnString(v string) error OnInt64(_ int64, n json.Number) error OnFloat64(_ float64, n json.Number) error OnObjectBegin(capacity int) error OnObjectKey(key string) error OnObjectEnd() error OnArrayBegin(capacity int) error OnArrayEnd() error Build() Root }
func NewBuilderSonic ¶
func NewBuilderSonic() BuilderSonic
type Encoder ¶
type Encoder interface { EncoderRaw EncoderString EncoderInt EncoderUint EncoderFloat EncoderBool }
type EncoderBool ¶
type EncoderBool interface {
Bool(v bool)
}
type EncoderFloat ¶
type EncoderInt ¶
type EncoderRaw ¶
type EncoderString ¶
type EncoderString interface {
String(s string)
}
type EncoderUint ¶
type Object ¶
func NewObjectWithCapacity ¶
type Root ¶
func UnmarshalRead ¶
Click to show internal directories.
Click to hide internal directories.