sdk.v3: Index | Files

package jsonlines

import ""

Package json lines mimicks standard library json Encoder and Decoder, but to encode and decode one JSON per line.


Package Files

decoder.go doc.go encoder.go


const (
    // DefaultBufferSize is the default buffer size for decoding. It will
    // be used whenever the given reader is not buffered.
    DefaultBufferSize = 1024 * 1024 * 4

type Decoder Uses

type Decoder interface {
    // Decode decodes the next JSON line into the given value.
    Decode(interface{}) error

Decoder decodes JSON lines.

func NewDecoder Uses

func NewDecoder(r io.Reader) Decoder

NewDecoder creates a new decoder with the given reader. If the given reader is not buffered, it will be wrapped with a *bufio.Reader.

type Encoder Uses

type Encoder interface {
    // Encode encodes the next value into a JSON line.
    Encode(interface{}) error

Encoder encodes JSON lines.

func NewEncoder Uses

func NewEncoder(w io.Writer) Encoder

NewEncoder creates a new encoder using the given writer.

Package jsonlines imports 3 packages (graph). Updated 2019-11-20. Refresh now. Tools for package owners.