encoding

package
v0.5.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TypeNil = iota
	TypeBool
	TypeInt
	TypeFloat
	TypeString
	TypeSlice
	TypeArray
	TypeObject
)

supported list of reader types.

Variables

This section is empty.

Functions

func EncodeTree

func EncodeTree(w io.Writer, tree map[string]any) error

Types

type Decoder added in v0.5.0

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

Decoder represents decoders for streaming data.

func NewDecoder added in v0.5.0

func NewDecoder(data io.Reader) *Decoder

NewDecoder creates a new instance of Decoder.

func (*Decoder) Decode added in v0.5.0

func (d *Decoder) Decode() (map[string]interface{}, error)

Decode decodes all the data stream at once.

func (*Decoder) Next added in v0.5.0

func (d *Decoder) Next() (map[string]interface{}, error)

Next implements iterator pattern and return data set by set. nolint:gocyclo TODO:get back and fix `gocyclo` problem.

type DecoderProvider added in v0.5.0

type DecoderProvider interface {
	// Next implements iterator pattern and return data set by set.
	Next() (map[string]interface{}, error)
	// Decode decodes all the data stream at once.
	Decode() (map[string]interface{}, error)
}

DecoderProvider provides an interface to work with stream decoder.

Jump to

Keyboard shortcuts

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