cjson

package
v4.6.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TAG_VARINT = 0
	TAG_DOUBLE = 1
	TAG_STRING = 2
	TAG_BOOL   = 3
	TAG_NULL   = 4
	TAG_ARRAY  = 5
	TAG_OBJECT = 6
	TAG_END    = 7
)

Variables

This section is empty.

Functions

func IsStructParsed

func IsStructParsed(src reflect.Type, parsed *map[string]bool) (bool, *map[string]bool)

Types

type ArrayHeader added in v1.9.2

type ArrayHeader struct {
	// contains filtered or unexported fields
}

type Cbool added in v1.10.0

type Cbool int8

type Cchar

type Cchar int8

type Cdouble added in v1.9.2

type Cdouble float64

to avoid gcc toolchain requirement types from C. Danger expectation about go struct packing is like C struct packing

type Cint added in v1.9.2

type Cint int32

type Cuint

type Cuint uint32

type Cunsigned added in v1.9.2

type Cunsigned uint32

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func (*Decoder) Decode

func (dec *Decoder) Decode(cjson []byte, dest interface{}) (err error)

func (*Decoder) DecodeCPtr

func (dec *Decoder) DecodeCPtr(cptr uintptr, dest interface{}) (err error)

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

func (*Encoder) Encode

func (enc *Encoder) Encode(src interface{}, wrser *Serializer) (stateToken int, err error)

func (*Encoder) EncodeRaw added in v1.5.0

func (enc *Encoder) EncodeRaw(src interface{}, wrser *Serializer) error

type LStringHeader

type LStringHeader struct {
	// contains filtered or unexported fields
}

type Logger

type Logger interface {
	Printf(level int, fmt string, msg ...interface{})
}

type PStringHeader added in v1.9.2

type PStringHeader struct {
	// contains filtered or unexported fields
}

type Serializer

type Serializer struct {
	// contains filtered or unexported fields
}

func NewPoolSerializer

func NewPoolSerializer() *Serializer

func NewSerializer

func NewSerializer(buf []byte) Serializer

func (*Serializer) Append

func (s *Serializer) Append(s2 Serializer)

func (*Serializer) Bytes

func (s *Serializer) Bytes() []byte

func (*Serializer) Close

func (s *Serializer) Close()

func (*Serializer) Eof

func (s *Serializer) Eof() bool

func (*Serializer) GetBytes

func (s *Serializer) GetBytes() (v []byte)

func (*Serializer) GetDouble

func (s *Serializer) GetDouble() (v float64)

func (*Serializer) GetUInt16 added in v1.10.0

func (s *Serializer) GetUInt16() (v uint16)

func (*Serializer) GetUInt32

func (s *Serializer) GetUInt32() (v uint32)

func (*Serializer) GetUInt64

func (s *Serializer) GetUInt64() (v uint64)

func (*Serializer) GetVBytes

func (s *Serializer) GetVBytes() (v []byte)

func (*Serializer) GetVString

func (s *Serializer) GetVString() (v string)

func (*Serializer) GetVarInt

func (s *Serializer) GetVarInt() int64

func (*Serializer) GetVarUInt

func (s *Serializer) GetVarUInt() uint64

func (*Serializer) Pos

func (s *Serializer) Pos() int

func (*Serializer) PutDouble

func (s *Serializer) PutDouble(v float64) *Serializer

func (*Serializer) PutUInt16 added in v1.10.0

func (s *Serializer) PutUInt16(v uint16) *Serializer

func (*Serializer) PutUInt32

func (s *Serializer) PutUInt32(v uint32) *Serializer

func (*Serializer) PutVBytes

func (s *Serializer) PutVBytes(v []byte) *Serializer

func (*Serializer) PutVString

func (s *Serializer) PutVString(v string) *Serializer

func (*Serializer) PutVarCUInt

func (s *Serializer) PutVarCUInt(v int) *Serializer

func (*Serializer) PutVarInt

func (s *Serializer) PutVarInt(v int64)

func (*Serializer) PutVarUInt

func (s *Serializer) PutVarUInt(v uint64) *Serializer

func (*Serializer) Truncate added in v1.5.0

func (s *Serializer) Truncate(pos int)

func (*Serializer) TruncateStart added in v1.10.0

func (s *Serializer) TruncateStart(pos int)

func (*Serializer) Write

func (s *Serializer) Write(v []byte) (n int, err error)

func (*Serializer) WriteString

func (s *Serializer) WriteString(vx string) *Serializer

type State

type State struct {
	*StateData
	// contains filtered or unexported fields
}

func NewState

func NewState() State

func (*State) Copy added in v1.5.0

func (state *State) Copy() State

func (*State) NewDecoder

func (state *State) NewDecoder(item interface{}, logger Logger) Decoder

func (*State) NewEncoder

func (state *State) NewEncoder() Encoder

func (*State) ReadPayloadType

func (state *State) ReadPayloadType(s *Serializer) State

func (*State) Reset added in v1.9.5

func (state *State) Reset()

type StateData added in v1.5.0

type StateData struct {
	Version    int32
	StateToken int32
	// contains filtered or unexported fields
}

type Validator added in v1.10.0

type Validator struct {
}

func (*Validator) Validate added in v1.10.0

func (enc *Validator) Validate(src interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL