jsoniter

package
v0.227.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 2 Imported by: 5

Documentation

Overview

Package jsoniter wraps json-iterator/go's Iterator methods with error returns so linting can catch unchecked errors. The underlying iterator's Error property is returned and not reset. See json-iterator/go for method documentation and additional methods that can be added to this library.

Index

Constants

View Source
const (
	InvalidValue = j.InvalidValue
	StringValue  = j.StringValue
	NumberValue  = j.NumberValue
	NilValue     = j.NilValue
	BoolValue    = j.BoolValue
	ArrayValue   = j.ArrayValue
	ObjectValue  = j.ObjectValue
)

Variables

View Source
var (
	ConfigDefault                       = j.ConfigDefault
	ConfigCompatibleWithStandardLibrary = j.ConfigCompatibleWithStandardLibrary
)

Functions

func RegisterTypeDecoder added in v0.203.0

func RegisterTypeDecoder(typ string, decoder ValDecoder)

func RegisterTypeEncoder added in v0.203.0

func RegisterTypeEncoder(typ string, encoder ValEncoder)

Types

type Iterator

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

func NewIterator

func NewIterator(i *j.Iterator) *Iterator

func Parse added in v0.203.0

func Parse(cfg j.API, reader io.Reader, bufSize int) (*Iterator, error)

func ParseBytes added in v0.203.0

func ParseBytes(cfg j.API, input []byte) (*Iterator, error)

func ParseString added in v0.203.0

func ParseString(cfg j.API, input string) (*Iterator, error)

func (*Iterator) CanReadArray added in v0.203.0

func (iter *Iterator) CanReadArray() bool

func (*Iterator) Marshal

func (iter *Iterator) Marshal(v interface{}) ([]byte, error)

func (*Iterator) Read

func (iter *Iterator) Read() (interface{}, error)

func (*Iterator) ReadAny

func (iter *Iterator) ReadAny() (j.Any, error)

func (*Iterator) ReadArray

func (iter *Iterator) ReadArray() (bool, error)

func (*Iterator) ReadBool

func (iter *Iterator) ReadBool() (bool, error)

func (*Iterator) ReadError added in v0.203.0

func (iter *Iterator) ReadError() error

func (*Iterator) ReadFloat32 added in v0.203.0

func (iter *Iterator) ReadFloat32() (float32, error)

func (*Iterator) ReadFloat64

func (iter *Iterator) ReadFloat64() (float64, error)

func (*Iterator) ReadInt added in v0.203.0

func (iter *Iterator) ReadInt() (int, error)

func (*Iterator) ReadInt16 added in v0.203.0

func (iter *Iterator) ReadInt16() (int16, error)

func (*Iterator) ReadInt32 added in v0.203.0

func (iter *Iterator) ReadInt32() (int32, error)

func (*Iterator) ReadInt64 added in v0.203.0

func (iter *Iterator) ReadInt64() (int64, error)

func (*Iterator) ReadInt8

func (iter *Iterator) ReadInt8() (int8, error)

func (*Iterator) ReadNil

func (iter *Iterator) ReadNil() (bool, error)

func (*Iterator) ReadObject

func (iter *Iterator) ReadObject() (string, error)

func (*Iterator) ReadString

func (iter *Iterator) ReadString() (string, error)

func (*Iterator) ReadUint16 added in v0.203.0

func (iter *Iterator) ReadUint16() (uint16, error)

func (*Iterator) ReadUint32 added in v0.203.0

func (iter *Iterator) ReadUint32() (uint32, error)

func (*Iterator) ReadUint64

func (iter *Iterator) ReadUint64() (uint64, error)

func (*Iterator) ReadUint64Pointer

func (iter *Iterator) ReadUint64Pointer() (*uint64, error)

func (*Iterator) ReadUint8 added in v0.203.0

func (iter *Iterator) ReadUint8() (uint8, error)

func (*Iterator) ReadVal

func (iter *Iterator) ReadVal(obj interface{}) error

func (*Iterator) ReportError

func (iter *Iterator) ReportError(op, msg string) error

func (*Iterator) SetError added in v0.203.0

func (iter *Iterator) SetError(err error)

func (*Iterator) Skip

func (iter *Iterator) Skip() error

func (*Iterator) SkipAndReturnBytes added in v0.203.0

func (iter *Iterator) SkipAndReturnBytes() ([]byte, error)

func (*Iterator) Unmarshal

func (iter *Iterator) Unmarshal(data []byte, v interface{}) error

func (*Iterator) WhatIsNext

func (iter *Iterator) WhatIsNext() (j.ValueType, error)

type Stream added in v0.203.0

type Stream = j.Stream

type ValDecoder added in v0.203.0

type ValDecoder = j.ValDecoder

type ValEncoder added in v0.203.0

type ValEncoder = j.ValEncoder

Jump to

Keyboard shortcuts

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