types

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MaxInt64StringLen   = 21
	MaxFloat64StringLen = 32
)
View Source
const (
	B_DOUBLE_UNQUOTE  = 0
	B_UNICODE_REPLACE = 1
)
View Source
const (
	// for unquote
	F_DOUBLE_UNQUOTE  = 1 << B_DOUBLE_UNQUOTE
	F_UNICODE_REPLACE = 1 << B_UNICODE_REPLACE
	// for j2t_fsm_exec
	F_ALLOW_UNKNOWN  = 1
	F_WRITE_DEFAULT  = 1 << 1
	F_VALUE_MAPPING  = 1 << 2
	F_HTTP_MAPPING   = 1 << 3
	F_STRING_INT     = 1 << 4
	F_WRITE_REQUIRE  = 1 << 5
	F_NO_BASE64      = 1 << 6
	F_WRITE_OPTIONAL = 1 << 7
	F_TRACE_BACK     = 1 << 8
	F_NO_WRITE_BASE  = 1 << 9
)
View Source
const (
	ERR_WRAP_SHIFT_CODE = 8
	ERR_WRAP_SHIFT_POS  = 32
)
View Source
const (
	J2T_KEY_CACHE_SIZE   = 1024
	J2T_FIELD_CACHE_SIZE = 4096
	J2T_REQS_CACHE_SIZE  = 4096
	J2T_DBUF_SIZE        = 800
)
View Source
const (
	VM_NONE   uint16 = 0
	VM_JSCONV uint16 = 101
)
View Source
const (
	MAX_RECURSE = 4096
)
View Source
const (
	SPACE_MASK = (1 << ' ') | (1 << '\t') | (1 << '\r') | (1 << '\n')
)
View Source
const (
	TB_SKIP_STACK_SIZE = 1024
)

Variables

This section is empty.

Functions

func FreeJ2TStateMachine

func FreeJ2TStateMachine(ret *J2TStateMachine)

func FreeStateMachine

func FreeStateMachine(fsm *StateMachine)

func FreeTStateMachine

func FreeTStateMachine(ret *TStateMachine)

Types

type FieldValue

type FieldValue struct {
	FieldID  int32
	ValBegin uint32
	ValEnd   uint32
}

type J2TExtra

type J2TExtra [_SIZE_J2TEXTRA]uint64

type J2TState

type J2TState struct {
	State    int
	JsonPos  int
	TypeDesc uintptr
	Extra    J2TExtra
}

func (J2TState) String

func (s J2TState) String() string

func (*J2TState) TdPointer

func (self *J2TState) TdPointer() uintptr

type J2TStateMachine

type J2TStateMachine struct {
	SP              int
	JT              JsonState
	ReqsCache       []byte
	KeyCache        []byte
	VT              [MAX_RECURSE]J2TState
	SM              StateMachine
	FieldCache      []int32
	FieldValueCache FieldValue
}

func NewJ2TStateMachine

func NewJ2TStateMachine() *J2TStateMachine

func (*J2TStateMachine) At

func (self *J2TStateMachine) At(i int) *J2TState

func (*J2TStateMachine) Drop

func (self *J2TStateMachine) Drop()

func (*J2TStateMachine) GrowFieldCache

func (ret *J2TStateMachine) GrowFieldCache(n int)

func (*J2TStateMachine) GrowKeyCache

func (ret *J2TStateMachine) GrowKeyCache(n int)

func (*J2TStateMachine) GrowReqCache

func (ret *J2TStateMachine) GrowReqCache(n int)

func (*J2TStateMachine) Init

func (ret *J2TStateMachine) Init(start int, desc unsafe.Pointer)

func (*J2TStateMachine) Next

func (self *J2TStateMachine) Next() *J2TState

func (*J2TStateMachine) Now

func (self *J2TStateMachine) Now() *J2TState

func (*J2TStateMachine) SetPos

func (ret *J2TStateMachine) SetPos(pos int)

func (*J2TStateMachine) String

func (fsm *J2TStateMachine) String() string

type J2T_STATE

type J2T_STATE uint8
const (
	J2T_VAL J2T_STATE = iota
	J2T_ARR
	J2T_OBJ
	J2T_KEY
	J2T_ELEM
	J2T_ARR_0
	J2T_OBJ_0

	J2T_VM J2T_STATE = 16
)

func (J2T_STATE) String

func (v J2T_STATE) String() string

type JsonState

type JsonState struct {
	Vt   ValueType
	Dv   float64
	Iv   int64
	Ep   int64
	Dbuf *byte
	Dcap int
}

func (JsonState) String

func (s JsonState) String() string

type ParsingError

type ParsingError uint
const (
	ERR_EOF                   ParsingError = 1
	ERR_INVALID_CHAR          ParsingError = 2
	ERR_INVALID_ESCAPE        ParsingError = 3
	ERR_INVALID_UNICODE       ParsingError = 4
	ERR_INTEGER_OVERFLOW      ParsingError = 5
	ERR_INVALID_NUMBER_FMT    ParsingError = 6
	ERR_RECURSE_EXCEED_MAX    ParsingError = 7
	ERR_FLOAT_INFINITY        ParsingError = 8
	ERR_DISMATCH_TYPE         ParsingError = 9
	ERR_NULL_REQUIRED         ParsingError = 10
	ERR_UNSUPPORT_THRIFT_TYPE ParsingError = 11
	ERR_UNKNOWN_FIELD         ParsingError = 12
	ERR_DISMATCH_TYPE2        ParsingError = 13
	ERR_DECODE_BASE64         ParsingError = 14
	ERR_OOM_BM                ParsingError = 16
	ERR_OOM_BUF               ParsingError = 17
	ERR_OOM_KEY               ParsingError = 18
	ERR_OOM_FIELD             ParsingError = 22
	ERR_OOM_FVAL              ParsingError = 23
	ERR_HTTP_MAPPING          ParsingError = 19
	ERR_HTTP_MAPPING_END      ParsingError = 21
	ERR_UNSUPPORT_VM_TYPE     ParsingError = 20
	ERR_VALUE_MAPPING_END     ParsingError = 24
)

func (ParsingError) Error

func (self ParsingError) Error() string

func (ParsingError) Message

func (self ParsingError) Message() string

type SearchingError

type SearchingError uint

type StateMachine

type StateMachine struct {
	Sp int
	Vt [MAX_RECURSE]int64
}

func NewStateMachine

func NewStateMachine() *StateMachine

type TState

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

type TStateMachine

type TStateMachine [TB_SKIP_STACK_SIZE]TState

func NewTStateMachine

func NewTStateMachine() *TStateMachine

type ValueType

type ValueType int64
const (
	V_EOF     ValueType = 1
	V_NULL    ValueType = 2
	V_TRUE    ValueType = 3
	V_FALSE   ValueType = 4
	V_ARRAY   ValueType = 5
	V_OBJECT  ValueType = 6
	V_STRING  ValueType = 7
	V_DOUBLE  ValueType = 8
	V_INTEGER ValueType = 9

	V_MAX ValueType
)

func (ValueType) String

func (v ValueType) String() string

Jump to

Keyboard shortcuts

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