Package decoder
import "github.com/goccy/go-json/internal/decoder"
- Overview
- Index
- Variables
- func AssignValue(src, dst reflect.Value) error
- func ReleaseRuntimeContext(ctx *RuntimeContext)
- func UnsafeNew(t *runtime.Type) unsafe.Pointer
- type BasePathNode
- type Decoder
- func CompileToGetDecoder(typ *runtime.Type) (Decoder, error)
- func NewPathDecoder() Decoder
- type Option
- type OptionFlags
- type Path
- func (p *Path) Field(sel string) (PathNode, bool, error)
- func (p *Path) Get(src, dst reflect.Value) error
- func (p *Path) String() string
- type PathBuilder
- func (b *PathBuilder) Build(buf []rune) (*Path, error)
- type PathIndexAllNode
- func (n *PathIndexAllNode) Field(fieldName string) (PathNode, bool, error)
- func (n *PathIndexAllNode) Get(src, dst reflect.Value) error
- func (n *PathIndexAllNode) Index(idx int) (PathNode, bool, error)
- func (n *PathIndexAllNode) String() string
- type PathIndexNode
- func (n *PathIndexNode) Field(fieldName string) (PathNode, bool, error)
- func (n *PathIndexNode) Get(src, dst reflect.Value) error
- func (n *PathIndexNode) Index(idx int) (PathNode, bool, error)
- func (n *PathIndexNode) String() string
- type PathNode
- type PathRecursiveNode
- func (n *PathRecursiveNode) Field(fieldName string) (PathNode, bool, error)
- func (n *PathRecursiveNode) Get(src, dst reflect.Value) error
- func (n *PathRecursiveNode) Index(_ int) (PathNode, bool, error)
- func (n *PathRecursiveNode) String() string
- type PathSelectorNode
- func (n *PathSelectorNode) Field(fieldName string) (PathNode, bool, error)
- func (n *PathSelectorNode) Get(src, dst reflect.Value) error
- func (n *PathSelectorNode) Index(idx int) (PathNode, bool, error)
- func (n *PathSelectorNode) String() string
- type PathString
- func (s PathString) Build() (*Path, error)
- type QuotePathSelector
- type RuntimeContext
- func TakeRuntimeContext() *RuntimeContext
- type Stream
- func NewStream(r io.Reader) *Stream
- func (s *Stream) Buffered() io.Reader
- func (s *Stream) More() bool
- func (s *Stream) PrepareForDecode() error
- func (s *Stream) Reset()
- func (s *Stream) Token() (interface{}, error)
- func (s *Stream) TotalOffset() int64
Package files
anonymous_field.go
array.go
assign.go
bool.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
slice.go
stream.go
string.go
struct.go
type.go
uint.go
unmarshal_json.go
unmarshal_text.go
wrapped_string.go
Variables
var (
EmptyInterfaceType = emptyInterfaceType
)
func AssignValue(src, dst reflect.Value) error
func ReleaseRuntimeContext(ctx *RuntimeContext)
func UnsafeNew(t *runtime.Type) unsafe.Pointer
type BasePathNode struct {
}
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 CompileToGetDecoder(typ *runtime.Type) (Decoder, error)
func NewPathDecoder() Decoder
type Option struct {
Flags OptionFlags
Context context.Context
Path *Path
}
type OptionFlags uint8
const (
FirstWinOption OptionFlags = 1 << iota
ContextOption
PathOption
)
type Path struct {
RootSelectorOnly bool
SingleQuotePathSelector bool
DoubleQuotePathSelector bool
}
func (*Path) Field
¶
func (p *Path) Field(sel string) (PathNode, bool, error)
func (*Path) Get
¶
func (p *Path) Get(src, dst reflect.Value) error
func (p *Path) String() string
type PathBuilder struct {
}
func (*PathBuilder) Build
¶
func (b *PathBuilder) Build(buf []rune) (*Path, error)
type PathIndexAllNode struct {
*BasePathNode
}
func (*PathIndexAllNode) Field
¶
func (n *PathIndexAllNode) Field(fieldName string) (PathNode, bool, error)
func (*PathIndexAllNode) Get
¶
func (n *PathIndexAllNode) Get(src, dst reflect.Value) error
func (*PathIndexAllNode) Index
¶
func (n *PathIndexAllNode) Index(idx int) (PathNode, bool, error)
func (*PathIndexAllNode) String
¶
func (n *PathIndexAllNode) String() string
type PathIndexNode struct {
*BasePathNode
}
func (*PathIndexNode) Field
¶
func (n *PathIndexNode) Field(fieldName string) (PathNode, bool, error)
func (*PathIndexNode) Get
¶
func (n *PathIndexNode) Get(src, dst reflect.Value) error
func (*PathIndexNode) Index
¶
func (n *PathIndexNode) Index(idx int) (PathNode, bool, error)
func (*PathIndexNode) String
¶
func (n *PathIndexNode) String() string
type PathNode interface {
fmt.Stringer
Index(idx int) (PathNode, bool, error)
Field(fieldName string) (PathNode, bool, error)
Get(src, dst reflect.Value) error
}
type PathRecursiveNode struct {
*BasePathNode
}
func (*PathRecursiveNode) Field
¶
func (n *PathRecursiveNode) Field(fieldName string) (PathNode, bool, error)
func (*PathRecursiveNode) Get
¶
func (n *PathRecursiveNode) Get(src, dst reflect.Value) error
func (*PathRecursiveNode) Index
¶
func (n *PathRecursiveNode) Index(_ int) (PathNode, bool, error)
func (*PathRecursiveNode) String
¶
func (n *PathRecursiveNode) String() string
type PathSelectorNode struct {
*BasePathNode
}
func (*PathSelectorNode) Field
¶
func (n *PathSelectorNode) Field(fieldName string) (PathNode, bool, error)
func (*PathSelectorNode) Get
¶
func (n *PathSelectorNode) Get(src, dst reflect.Value) error
func (*PathSelectorNode) Index
¶
func (n *PathSelectorNode) Index(idx int) (PathNode, bool, error)
func (*PathSelectorNode) String
¶
func (n *PathSelectorNode) String() string
type PathString string
func (PathString) Build
¶
func (s PathString) Build() (*Path, error)
type QuotePathSelector int
const (
SingleQuotePathSelector QuotePathSelector = 1
DoubleQuotePathSelector QuotePathSelector = 2
)
type RuntimeContext struct {
Buf []byte
Option *Option
}
func TakeRuntimeContext() *RuntimeContext
type Stream struct {
UseNumber bool
DisallowUnknownFields bool
Option *Option
}
func NewStream(r io.Reader) *Stream
func (s *Stream) Buffered() io.Reader
func (*Stream) More
¶
func (s *Stream) More() bool
func (s *Stream) PrepareForDecode() error
func (*Stream) Reset
¶
func (s *Stream) Reset()
func (*Stream) Token
¶
func (s *Stream) Token() (interface{}, error)
func (s *Stream) TotalOffset() int64