jsonstream

package
v2.260.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 4 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{ *json.Decoder }

Decoder is a json.Decoder wrapper which adds convenience methods for stream decoding.

func New

func New(r io.Reader) Decoder

New creates a new Decoder. Decoder is a pointer type: copying does not clone state.

func (Decoder) DecodeName

func (dec Decoder) DecodeName() (string, error)

DecodeName decodes a token and checks that it is a non-null string

func (Decoder) DecodeNumber

func (dec Decoder) DecodeNumber() (json.Number, error)

DecodeNumber decodes a token and checks that it is a non-null number

func (Decoder) DecodeString

func (dec Decoder) DecodeString() (*string, error)

DecodeString decodes a token and check that it is a string or null. It returns nil if a null was found.

func (Decoder) EndComposite

func (dec Decoder) EndComposite() error

EndComposite will decode and discard the end of an array or object

func (Decoder) StartArrayComposite

func (dec Decoder) StartArrayComposite() (bool, error)

StartArrayComposite decodes the start of a JSON array, i.e. '['

func (Decoder) StartObjectComposite

func (dec Decoder) StartObjectComposite() (bool, error)

StartObjectComposite decodes the start of a JSON object, i.e. '{'

Jump to

Keyboard shortcuts

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