...

Package decoder

import "github.com/goccy/go-json/internal/decoder"
Overview
Index

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

func AssignValue(src, dst reflect.Value) error

func ReleaseRuntimeContext

func ReleaseRuntimeContext(ctx *RuntimeContext)

func UnsafeNew

func UnsafeNew(t *runtime.Type) unsafe.Pointer

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 CompileToGetDecoder

func CompileToGetDecoder(typ *runtime.Type) (Decoder, error)

func NewPathDecoder

func NewPathDecoder() Decoder

type Option

type Option struct {
    Flags   OptionFlags
    Context context.Context
    Path    *Path
}

type OptionFlags

type OptionFlags uint8
const (
    FirstWinOption OptionFlags = 1 << iota
    ContextOption
    PathOption
)

type Path

type Path struct {
    RootSelectorOnly        bool
    SingleQuotePathSelector bool
    DoubleQuotePathSelector bool
    // contains filtered or unexported fields
}

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 (*Path) String

func (p *Path) String() string

type PathBuilder

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

func (*PathBuilder) Build

func (b *PathBuilder) Build(buf []rune) (*Path, error)

type PathIndexAllNode

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

type PathIndexNode struct {
    *BasePathNode
    // contains filtered or unexported fields
}

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

type PathNode interface {
    fmt.Stringer
    Index(idx int) (PathNode, bool, error)
    Field(fieldName string) (PathNode, bool, error)
    Get(src, dst reflect.Value) error
    // contains filtered or unexported methods
}

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) 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

type PathSelectorNode struct {
    *BasePathNode
    // contains filtered or unexported fields
}

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

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
}

func TakeRuntimeContext

func TakeRuntimeContext() *RuntimeContext

type Stream

type Stream struct {
    UseNumber             bool
    DisallowUnknownFields bool
    Option                *Option
    // contains filtered or unexported fields
}

func NewStream

func NewStream(r io.Reader) *Stream

func (*Stream) Buffered

func (s *Stream) Buffered() io.Reader

func (*Stream) More

func (s *Stream) More() bool

func (*Stream) PrepareForDecode

func (s *Stream) PrepareForDecode() error

func (*Stream) Reset

func (s *Stream) Reset()

func (*Stream) Token

func (s *Stream) Token() (interface{}, error)

func (*Stream) TotalOffset

func (s *Stream) TotalOffset() int64