Documentation
¶
Overview ¶
Package ndjson implements newline-delimited JSON as a codec.Codec. Each record is a JSON value followed by a single '\n' — the format is intentionally line-oriented so that partial reads remain parseable. The codec accepts slice values: Marshal emits one record per element, Unmarshal splits on '\n' and decodes each non-empty line into a new slice element. It is a codec.StreamingCodec too: its stream decoder hands one record per Decode, reading one line at a time, and its stream encoder writes one line per Encode.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( //: register the singleton and expose it as a typed package var. Codec codec.Codec = codec.Register(&ndjsonCodec{}) )
The registered singleton. Its aliases are literals in MIMETypes and Extensions, not package tables: Register reads them through the Codec interface, which orders no table before this initialiser (see core/data/codec.Register).
Functions ¶
Types ¶
This section is empty.