zio

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2024 License: BSD-3-Clause Imports: 4 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseReaders

func CloseReaders(readers []Reader) error

func Copy

func Copy(dst Writer, src Reader) error

Copy copies src to dst a la io.Copy.

func CopyWithContext

func CopyWithContext(ctx context.Context, dst Writer, src Reader) error

func Extension

func Extension(format string) string

func NopCloser

func NopCloser(w io.Writer) io.WriteCloser

NopCloser returns a WriteCloser with a no-op Close method wrapping the provided Writer w.

Types

type Peeker

type Peeker struct {
	Reader
	// contains filtered or unexported fields
}

Peeker wraps a Stream while adding a Peek method, which allows inspection of the next item to be read without actually reading it.

func NewPeeker

func NewPeeker(reader Reader) *Peeker

func (*Peeker) Peek

func (p *Peeker) Peek() (*zed.Value, error)

func (*Peeker) Read

func (p *Peeker) Read() (*zed.Value, error)

type ReadCloser

type ReadCloser interface {
	Reader
	io.Closer
}

func NewReadCloser

func NewReadCloser(r Reader, c io.Closer) ReadCloser

func NopReadCloser

func NopReadCloser(r Reader) ReadCloser

type Reader

type Reader interface {
	Read() (val *zed.Value, err error)
}

Reader wraps the Read method.

Read returns the next value and a nil error, a nil value and the next error, or a nil value and nil error to indicate that no values remain.

Read never returns a non-nil value and non-nil error together, and it never returns io.EOF.

Implementations retain ownership of val and val.Bytes, and a subsequent Read may overwrite them. Clients that wish to use val or val.Bytes after the next Read must make a copy.

func ConcatReader

func ConcatReader(readers ...Reader) Reader

ConcatReader returns a Reader that is the logical concatenation of readers, which are read sequentially. Its Read methed returns any non-nil error returned by a reader and returns end of stream after all readers have returned end of stream.

type WriteCloser

type WriteCloser interface {
	Writer
	io.Closer
}

type Writer

type Writer interface {
	Write(val zed.Value) error
}

Writer wraps the Write method.

Implementations must not retain val or val.Bytes.

func MultiWriter

func MultiWriter(writers ...Writer) Writer

Directories

Path Synopsis
Package zngio provides an API for reading and writing zng values and directives in binary zng format.
Package zngio provides an API for reading and writing zng values and directives in binary zng format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL