decoder

package
v2.26.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: MIT, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReleaseRuntimeContext

func ReleaseRuntimeContext(ctx *RuntimeContext)

Types

type Decoder

type Decoder interface {
	Decode(*RuntimeContext, int64, int64, unsafe.Pointer) (int64, error)
	DecodeStream(*Stream, int64, unsafe.Pointer) error
}

func CompileToGetDecoder

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

type Option

type Option struct {
	Flags   OptionFlags
	Context context.Context
}

type OptionFlags

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

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

Jump to

Keyboard shortcuts

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