cjson

package
v2.6.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 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

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

type Cbool

type Cbool int8

type Cdouble

type Cdouble float64

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

type Cint

type Cint int32

type Cunsigned

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

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

type Logger

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

type PStringHeader

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

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

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

func (s *Serializer) Truncate(pos int)

func (*Serializer) TruncateStart

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

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

func (state *State) Reset()

type StateData

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

type Validator

type Validator struct {
}

func (*Validator) Validate

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