Documentation ¶
Overview ¶
Package zngio provides an API for reading and writing zng values and directives in binary zng format. The Reader and Writer types implement the the zio.Reader and zio.Writer interfaces. Since these methods read and write only zed.Records, but the zng format includes additional functionality, other methods are available to read/write zng comments and include virtual channel numbers in the stream. Virtual channels provide a way to indicate which output of a flowgraph a result came from when a flowgraph computes multiple output channels. The zng values in this zng value are "machine format" as prescirbed by the ZNG spec. The vanilla zio.Reader and zio.Writer implementations ignore application-specific payloads (e.g., channel encodings).
Index ¶
Constants ¶
const ( TypesFrame = 0 ValuesFrame = 1 ControlFrame = 2 )
const ( EOS = 0xff ControlFormatZNG = 0 ControlFormatJSON = 1 ControlFormatZSON = 2 ControlFormatString = 3 ControlFormatBinary = 4 )
const ( ReadSize = 512 * 1024 MaxSize = 1024 * 1024 * 1024 TypeLimit = 10000 )
const ( TypeDefRecord = 0 TypeDefArray = 1 TypeDefSet = 2 TypeDefMap = 3 TypeDefUnion = 4 TypeDefEnum = 5 TypeDefError = 6 TypeDefName = 7 )
const DefaultFrameThresh = 512 * 1024
DefaultFrameThresh is a reasonable default for WriterOpts.FrameThresh.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompressionFormat ¶ added in v1.0.0
type CompressionFormat int
const CompressionFormatLZ4 CompressionFormat = 0x00
type Decoder ¶ added in v1.0.0
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶ added in v1.0.0
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func NewEncoder() *Encoder
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReaderWithOpts ¶
func (*Reader) Close ¶ added in v1.0.0
Close guarantees that the underlying io.Reader is not read after it returns.
func (*Reader) NewScanner ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewWriter ¶
func NewWriter(w io.WriteCloser) *Writer
NewWriter returns a writer to w with reasonable default options. Specifically, it enables compression and sets the frame threshold to DefaultFrameThresh.
func NewWriterWithOpts ¶ added in v1.2.0
func NewWriterWithOpts(w io.WriteCloser, opts WriterOpts) *Writer
NewWriterWithOpts returns a writer to w with opts.
func (*Writer) DisableCompression ¶ added in v1.0.0
func (w *Writer) DisableCompression()