jsonv2

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	*jsontext.Decoder
}

Decoder wraps jsontext.Decoder to implement the json.Decoder interface. It provides streaming JSON decoding with convenience methods for reading tokens and values.

func (*Decoder) PeekKind

func (d *Decoder) PeekKind() json.Kind

PeekKind returns the Kind of the next JSON token without consuming it.

func (*Decoder) ReadToken

func (d *Decoder) ReadToken() (string, json.Kind, error)

ReadToken reads the next JSON token and returns its string representation, kind, and any error encountered. The decoder state advances past the returned token.

func (*Decoder) ReadValue

func (d *Decoder) ReadValue() ([]byte, error)

ReadValue reads the next JSON value (scalar, object, or array) as raw bytes. The decoder state advances past the returned value.

func (*Decoder) SkipValue

func (d *Decoder) SkipValue() error

SkipValue skips over the next JSON value (scalar, object, or array). The decoder state advances past the skipped value.

type Encoder

type Encoder struct {
	*jsontext.Encoder
}

Encoder wraps jsontext.Encoder to implement the json.Encoder interface.

func (*Encoder) WriteValue

func (e *Encoder) WriteValue(v []byte) error

WriteValue writes a JSON value to the encoder.

Jump to

Keyboard shortcuts

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