streaming

package
v1.3.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package streaming implements encoder and decoder for streams of runtime.Objects over io.Writer/Readers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	// Decode will return io.EOF when no more objects are available.
	Decode(defaults *unversioned.GroupVersionKind, into runtime.Object) (runtime.Object, *unversioned.GroupVersionKind, error)
}

Decoder is a runtime.Decoder from a stream.

func NewDecoder

func NewDecoder(r io.Reader, d runtime.Decoder) Decoder

NewDecoder creates a streaming decoder that reads object chunks from r and decodes them with d. The reader is expected to return ErrShortRead if the provided buffer is not large enough to read an entire object.

type Encoder

type Encoder interface {
	// Encode will write the provided object to the stream or return an error. It obeys the same
	// contract as runtime.Encoder.
	Encode(obj runtime.Object, overrides ...unversioned.GroupVersion) error
}

Encoder is a runtime.Encoder on a stream.

func NewEncoder

func NewEncoder(w io.Writer, e runtime.Encoder) Encoder

NewEncoder returns a new streaming encoder.

type Framer

type Framer interface {
	NewFrameReader(r io.Reader) io.Reader
	NewFrameWriter(w io.Writer) io.Writer
}

Framer is a factory for creating readers and writers that obey a particular framing pattern.

type Serializer

type Serializer interface {
	NewEncoder(w io.Writer) Encoder
	NewDecoder(r io.Reader) Decoder
}

Serializer is a factory for creating encoders and decoders that work over streams.

Jump to

Keyboard shortcuts

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