Documentation
¶
Overview ¶
Package ndjson provides NDJSON (newline-delimited JSON) format support for omnistorage.
Index ¶
Constants ¶
const ( // DefaultBufferSize is the default buffer size for writers. DefaultBufferSize = 64 * 1024 // 64KB )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader implements omnistorage.RecordReader for NDJSON format. Each record is read as a single line (delimited by newlines).
func NewReader ¶
func NewReader(r io.ReadCloser) *Reader
NewReader creates a new NDJSON reader that reads from the given io.ReadCloser. The reader will be closed when the NDJSON reader is closed.
func NewReaderSize ¶
func NewReaderSize(r io.ReadCloser, bufferSize int) *Reader
NewReaderSize creates a new NDJSON reader with the specified buffer size. The buffer size determines the maximum line length that can be read.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer implements omnistorage.RecordWriter for NDJSON format. Each record is written as a single line followed by a newline character.
func NewWriter ¶
func NewWriter(w io.WriteCloser) *Writer
NewWriter creates a new NDJSON writer that writes to the given io.WriteCloser. The writer will be closed when the NDJSON writer is closed.
func NewWriterSize ¶
func NewWriterSize(w io.WriteCloser, bufferSize int) *Writer
NewWriterSize creates a new NDJSON writer with the specified buffer size.