/jindex

Indexed reading of JSON streams in Go

Primary LanguageGoMIT LicenseMIT

jindex

-- import "github.com/sebcat/jindex"

Indexed reading of JSON streams

Usage

type Decoder

type Decoder struct {
}

JSON decoder keeping track of the number of read bytes

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

Create a new JSON decoder, keeping track of the number of read bytes

func (*Decoder) Decode

func (d *Decoder) Decode(v interface{}) error

Read the next JSON-encoded value and store it in the value pointed to by v

func (*Decoder) NRead

func (d *Decoder) NRead() int64

Return the number of bytes read by this decoder