Documentation
¶
Overview ¶
Code generated by internal/cmd/generator. DO NOT EDIT!
Index ¶
- Constants
- Variables
- func AppendBool(_ *RuntimeContext, b []byte, v bool) []byte
- func AppendByteSlice(_ *RuntimeContext, b []byte, src []byte) []byte
- func AppendComma(_ *RuntimeContext, b []byte) []byte
- func AppendCommaIndent(_ *RuntimeContext, b []byte) []byte
- func AppendFloat32(_ *RuntimeContext, b []byte, v float32) []byte
- func AppendFloat64(_ *RuntimeContext, b []byte, v float64) []byte
- func AppendIndent(ctx *RuntimeContext, b []byte, indent uint32) []byte
- func AppendInt(_ *RuntimeContext, out []byte, p uintptr, code *Opcode) []byte
- func AppendMarshalJSON(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error)
- func AppendMarshalJSONIndent(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error)
- func AppendMarshalText(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error)
- func AppendMarshalTextIndent(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error)
- func AppendNull(_ *RuntimeContext, b []byte) []byte
- func AppendNumber(_ *RuntimeContext, b []byte, n json.Number) ([]byte, error)
- func AppendString(ctx *RuntimeContext, buf []byte, s string) []byte
- func AppendStructEnd(_ *RuntimeContext, b []byte) []byte
- func AppendStructEndIndent(ctx *RuntimeContext, code *Opcode, b []byte) []byte
- func AppendUint(_ *RuntimeContext, out []byte, p uintptr, code *Opcode) []byte
- func Compact(buf *bytes.Buffer, src []byte, escape bool) error
- func ErrMarshalerWithCode(code *Opcode, err error) *errors.MarshalerError
- func ErrUnsupportedFloat(v float64) *errors.UnsupportedValueError
- func ErrUnsupportedValue(code *Opcode, ptr uintptr) *errors.UnsupportedValueError
- func Indent(buf *bytes.Buffer, src []byte, prefix, indentStr string) error
- func IsNilForMarshaler(v interface{}) bool
- func Load(base uintptr, idx uintptr) uintptr
- func LoadNPtr(base uintptr, idx uintptr, ptrNum int) uintptr
- func MapIterInit(mapType *runtime.Type, m unsafe.Pointer, it *mapIter)
- func MapIterKey(it *mapIter) unsafe.Pointer
- func MapIterNext(it *mapIter)
- func MapIterValue(it *mapIter) unsafe.Pointer
- func MapLen(m unsafe.Pointer) int
- func PtrToBool(p uintptr) bool
- func PtrToBytes(p uintptr) []byte
- func PtrToFloat32(p uintptr) float32
- func PtrToFloat64(p uintptr) float64
- func PtrToInterface(code *Opcode, p uintptr) interface{}
- func PtrToNPtr(p uintptr, ptrNum int) uintptr
- func PtrToNumber(p uintptr) json.Number
- func PtrToPtr(p uintptr) uintptr
- func PtrToSlice(p uintptr) *runtime.SliceHeader
- func PtrToString(p uintptr) string
- func PtrToUint64(p uintptr) uint64
- func PtrToUnsafePtr(p uintptr) unsafe.Pointer
- func ReleaseMapContext(c *MapContext)
- func ReleaseRuntimeContext(ctx *RuntimeContext)
- func SetFieldQueryToContext(ctx context.Context, query *FieldQuery) context.Context
- func Store(base uintptr, idx uintptr, p uintptr)
- type AnonymousCode
- type ArrayCode
- type BoolCode
- type BytesCode
- type Code
- type CodeKind
- type CodeType
- type ColorFormat
- type ColorScheme
- type CompiledCode
- type Compiler
- type EncodeFormat
- type EncodeFormatScheme
- type FieldQuery
- type FieldQueryString
- type FloatCode
- type IntCode
- type InterfaceCode
- type MapCode
- type MapContext
- type MapItem
- type Mapslice
- type MarshalJSONCode
- type MarshalTextCode
- type OpFlags
- type OpType
- func (t OpType) CodeType() CodeType
- func (t OpType) FieldToEnd() OpType
- func (t OpType) FieldToOmitEmptyField() OpType
- func (t OpType) HeadToOmitEmptyHead() OpType
- func (t OpType) HeadToPtrHead() OpType
- func (t OpType) IsMultipleOpField() bool
- func (t OpType) IsMultipleOpHead() bool
- func (t OpType) PtrHeadToHead() OpType
- func (t OpType) String() string
- type Opcode
- func (c *Opcode) Dump() string
- func (c *Opcode) IsEnd() bool
- func (c *Opcode) IterNext() *Opcode
- func (c *Opcode) MaxIdx() uint32
- func (c *Opcode) ToFieldType(isString bool) OpType
- func (c *Opcode) ToHeaderType(isString bool) OpType
- func (c *Opcode) TotalLength() int
- func (c *Opcode) Validate() error
- type OpcodeSet
- type Opcodes
- type Option
- type OptionFlag
- type PtrCode
- type RuntimeContext
- type SliceCode
- type StringCode
- type StructCode
- type StructFieldCode
- type UintCode
Constants ¶
View Source
const StartDetectingCyclesAfter = 1000
Variables ¶
View Source
var ( Marshal func(interface{}) ([]byte, error) Unmarshal func([]byte, interface{}) error )
Functions ¶
func AppendBool ¶
func AppendBool(_ *RuntimeContext, b []byte, v bool) []byte
func AppendByteSlice ¶
func AppendByteSlice(_ *RuntimeContext, b []byte, src []byte) []byte
func AppendComma ¶
func AppendComma(_ *RuntimeContext, b []byte) []byte
func AppendCommaIndent ¶
func AppendCommaIndent(_ *RuntimeContext, b []byte) []byte
func AppendFloat32 ¶
func AppendFloat32(_ *RuntimeContext, b []byte, v float32) []byte
func AppendFloat64 ¶
func AppendFloat64(_ *RuntimeContext, b []byte, v float64) []byte
func AppendIndent ¶
func AppendIndent(ctx *RuntimeContext, b []byte, indent uint32) []byte
func AppendMarshalJSON ¶
func AppendMarshalJSON(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error)
func AppendMarshalJSONIndent ¶
func AppendMarshalJSONIndent(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error)
func AppendMarshalText ¶
func AppendMarshalText(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error)
func AppendMarshalTextIndent ¶
func AppendMarshalTextIndent(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error)
func AppendNull ¶
func AppendNull(_ *RuntimeContext, b []byte) []byte
func AppendNumber ¶
func AppendString ¶
func AppendString(ctx *RuntimeContext, buf []byte, s string) []byte
func AppendStructEnd ¶
func AppendStructEnd(_ *RuntimeContext, b []byte) []byte
func AppendStructEndIndent ¶
func AppendStructEndIndent(ctx *RuntimeContext, code *Opcode, b []byte) []byte
func AppendUint ¶
func AppendUint(_ *RuntimeContext, out []byte, p uintptr, code *Opcode) []byte
func ErrMarshalerWithCode ¶
func ErrMarshalerWithCode(code *Opcode, err error) *errors.MarshalerError
func ErrUnsupportedFloat ¶
func ErrUnsupportedFloat(v float64) *errors.UnsupportedValueError
func ErrUnsupportedValue ¶
func ErrUnsupportedValue(code *Opcode, ptr uintptr) *errors.UnsupportedValueError
func IsNilForMarshaler ¶
func IsNilForMarshaler(v interface{}) bool
func MapIterKey ¶
func MapIterNext ¶
func MapIterNext(it *mapIter)
func MapIterValue ¶
func PtrToBytes ¶
func PtrToFloat32 ¶
func PtrToFloat64 ¶
func PtrToInterface ¶
func PtrToNumber ¶
func PtrToSlice ¶
func PtrToSlice(p uintptr) *runtime.SliceHeader
func PtrToString ¶
func PtrToUint64 ¶
func PtrToUnsafePtr ¶
func ReleaseMapContext ¶
func ReleaseMapContext(c *MapContext)
func ReleaseRuntimeContext ¶
func ReleaseRuntimeContext(ctx *RuntimeContext)
func SetFieldQueryToContext ¶
func SetFieldQueryToContext(ctx context.Context, query *FieldQuery) context.Context
Types ¶
type AnonymousCode ¶
type AnonymousCode interface {
ToAnonymousOpcode(*compileContext) Opcodes
}
type ArrayCode ¶
type ArrayCode struct {
// contains filtered or unexported fields
}
func (*ArrayCode) Filter ¶
func (c *ArrayCode) Filter(_ *FieldQuery) Code
type BoolCode ¶
type BoolCode struct {
// contains filtered or unexported fields
}
func (*BoolCode) Filter ¶
func (c *BoolCode) Filter(_ *FieldQuery) Code
type BytesCode ¶
type BytesCode struct {
// contains filtered or unexported fields
}
func (*BytesCode) Filter ¶
func (c *BytesCode) Filter(_ *FieldQuery) Code
type Code ¶
type Code interface {
Kind() CodeKind
ToOpcode(*compileContext) Opcodes
Filter(*FieldQuery) Code
}
type CodeType ¶
type CodeType int
const ( CodeOp CodeType = 0 CodeArrayHead CodeType = 1 CodeArrayElem CodeType = 2 CodeSliceHead CodeType = 3 CodeSliceElem CodeType = 4 CodeMapHead CodeType = 5 CodeMapKey CodeType = 6 CodeMapValue CodeType = 7 CodeMapEnd CodeType = 8 CodeRecursive CodeType = 9 CodeStructField CodeType = 10 CodeStructEnd CodeType = 11 )
type ColorFormat ¶
type ColorFormat = EncodeFormat
type ColorScheme ¶
type ColorScheme = EncodeFormatScheme
type CompiledCode ¶
type EncodeFormat ¶
type EncodeFormat struct {
Header string
}
type EncodeFormatScheme ¶
type EncodeFormatScheme struct {
Int EncodeFormat
Uint EncodeFormat
Float EncodeFormat
Bool EncodeFormat
String EncodeFormat
Binary EncodeFormat
ObjectKey EncodeFormat
Null EncodeFormat
}
type FieldQuery ¶
type FieldQuery struct {
Name string
Fields []*FieldQuery
// contains filtered or unexported fields
}
func FieldQueryFromContext ¶
func FieldQueryFromContext(ctx context.Context) *FieldQuery
func (*FieldQuery) Hash ¶
func (q *FieldQuery) Hash() string
func (*FieldQuery) MarshalJSON ¶
func (q *FieldQuery) MarshalJSON() ([]