Documentation ¶
Overview ¶
Package zng21io provides low performance, read-only for the old ZNG format prior to the changes introduced in January 2021.
Index ¶
Constants ¶
const ( ReadSize = 512 * 1024 MaxSize = 10 * 1024 * 1024 TypeLimit = 10000 )
Variables ¶
var ( ErrNotContainer = errors.New("not a container") ErrNotSingleton = errors.New("not a single container") )
var ErrTrunc = errors.New("truncated type value convert zng21 to zng")
Functions ¶
func AppendUvarint ¶
AppendUvarint is like encoding/binary.PutUvarint but appends to dst instead of writing into it.
Types ¶
type AppMessage ¶
type Bytes ¶
type Bytes []byte
Bytes is the serialized representation of a sequence of ZNG values.
func AppendContainer ¶
AppendContainer appends val to dst as a container value and returns the extended buffer.
func AppendNull ¶
AppendNull appends a null value to dst as either a primitive or container value and returns the extended buffer.
func AppendPrimitive ¶
AppendPrimitive appends val to dst as a primitive value and returns the extended buffer.
func (Bytes) ContainerBody ¶
ContainerBody returns the body of the receiver, which must hold a single container. If the receiver is not a container, ErrNotContainer is returned. If the receiver is not a single container, ErrNotSingleton is returned.
type Iter ¶
type Iter Bytes
Iter iterates over the sequence of values encoded in Bytes.
func (*Iter) Next ¶
Next returns the body of the next value along with a boolean that is true if the value is a container. It returns an empty slice for an empty or zero-length value and nil for a Zed null value. The container boolean is not meaningful if the returned Bytes slice is nil. Next panics if the next value is malformed.
func (*Iter) NextTagAndBody ¶
NextTagAndBody returns the next value as a slice containing the value's undecoded tag followed by its body along with a boolean that is true if the value is a container. NextTagAndBody panics if the next value is malformed.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReaderWithOpts ¶
func (*Reader) ReadPayload ¶
func (r *Reader) ReadPayload() (*zed21.Value, *AppMessage, error)