Documentation
¶
Index ¶
- Variables
- func AssignValue(src, dst reflect.Value) error
- func ReleaseRuntimeContext(ctx *RuntimeContext)
- func ResolveLongBody(mode *bool, dataLen int) bool
- func UnsafeNew(t *runtime.Type) unsafe.Pointer
- type BasePathNode
- type Decoder
- type Option
- type OptionFlags
- type Path
- type PathBuilder
- type PathIndexAllNode
- type PathIndexNode
- type PathNode
- type PathRecursiveNode
- type PathSelectorNode
- type PathString
- type QuotePathSelector
- type RuntimeContext
- type Stream
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EmptyInterfaceType = emptyInterfaceType
)
Functions ¶
func AssignValue ¶
func ReleaseRuntimeContext ¶
func ReleaseRuntimeContext(ctx *RuntimeContext)
func ResolveLongBody ¶
ResolveLongBody resolves the LongBodyMode option against the actual input size. The resolved value lives in RuntimeContext.LongBody so hot paths read a plain bool.
Types ¶
type BasePathNode ¶
type BasePathNode struct {
// contains filtered or unexported fields
}
type Decoder ¶
type Decoder interface {
Decode(*RuntimeContext, int64, int64, unsafe.Pointer) (int64, error)
DecodePath(*RuntimeContext, int64, int64) ([][]byte, int64, error)
DecodeStream(*Stream, int64, unsafe.Pointer) error
}
func CompileToGetDecoderWithBufReuse ¶
CompileToGetDecoderWithBufReuse additionally reports whether decoded values can never alias the input buffer (see canReuseTypeBuf).
func NewPathDecoder ¶
func NewPathDecoder() Decoder
type Option ¶
type Option struct {
Flags OptionFlags
// LongBodyMode selects the scanning/pooling profile: nil means
// auto-detect from the input size (see ResolveLongBody), non-nil is an
// explicit override.
LongBodyMode *bool
// TimeFormats, when non-empty, makes time.Time destinations parse via
// time.Parse with these layouts, tried in order until one succeeds.
TimeFormats []string
Context context.Context
Path *Path
}
type OptionFlags ¶
type OptionFlags uint8
const ( FirstWinOption OptionFlags = 1 << iota ContextOption PathOption // RequireOption makes struct decoding fail with RequiredFieldError // when a required field (no omitempty, non-nilable type) is missing // or null. RequireOption )
type Path ¶
type PathBuilder ¶
type PathBuilder struct {
// contains filtered or unexported fields
}
type PathIndexAllNode ¶
type PathIndexAllNode struct {
*BasePathNode
}
func (*PathIndexAllNode) Field ¶
func (n *PathIndexAllNode) Field(fieldName string) (PathNode, bool, error)
func (*PathIndexAllNode) String ¶
func (n *PathIndexAllNode) String() string
type PathIndexNode ¶
type PathIndexNode struct {
*BasePathNode
// contains filtered or unexported fields
}
func (*PathIndexNode) Field ¶
func (n *PathIndexNode) Field(fieldName string) (PathNode, bool, error)
func (*PathIndexNode) String ¶
func (n *PathIndexNode) String() string
type PathRecursiveNode ¶
type PathRecursiveNode struct {
*BasePathNode
// contains filtered or unexported fields
}
func (*PathRecursiveNode) Field ¶
func (n *PathRecursiveNode) Field(fieldName string) (PathNode, bool, error)
func (*PathRecursiveNode) String ¶
func (n *PathRecursiveNode) String() string
type PathSelectorNode ¶
type PathSelectorNode struct {
*BasePathNode
// contains filtered or unexported fields
}
func (*PathSelectorNode) Field ¶
func (n *PathSelectorNode) Field(fieldName string) (PathNode, bool, error)
func (*PathSelectorNode) String ¶
func (n *PathSelectorNode) String() string
type PathString ¶
type PathString string
func (PathString) Build ¶
func (s PathString) Build() (*Path, error)
type QuotePathSelector ¶
type QuotePathSelector int
const ( SingleQuotePathSelector QuotePathSelector = 1 DoubleQuotePathSelector QuotePathSelector = 2 )
type RuntimeContext ¶
type RuntimeContext struct {
Buf []byte
Option *Option
LongBody bool // resolved LongBodyMode (see ResolveLongBody)
}
func TakeRuntimeContext ¶
func TakeRuntimeContext() *RuntimeContext
type Stream ¶
type Stream struct {
UseNumber bool
DisallowUnknownFields bool
Option *Option
// contains filtered or unexported fields
}
func (*Stream) PrepareForDecode ¶
func (*Stream) TotalOffset ¶
Source Files
¶
- anonymous_field.go
- array.go
- assign.go
- bool.go
- buf_reuse.go
- bytes.go
- compile.go
- compile_norace.go
- context.go
- float.go
- func.go
- int.go
- interface.go
- invalid.go
- map.go
- number.go
- option.go
- path.go
- ptr.go
- skip_string_delim_simd.go
- slice.go
- stream.go
- string.go
- struct.go
- swar.go
- type.go
- uint.go
- unmarshal_json.go
- unmarshal_text.go
- wrapped_string.go
Click to show internal directories.
Click to hide internal directories.