streampb

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder wraps an underlying io.Reader and allows you to stream proto decodings on it.

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder creates a streaming protobuf decoder.

func (*Decoder) Decode

func (d *Decoder) Decode(v proto.Message) (int64, error)

Decode takes a proto.Message and unmarshals the next payload in the underlying io.Reader. It returns an EOF when it's done.

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

Encoder wraps an underlying io.Writer and allows you to stream proto encodings on it.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder creates a streaming protobuf encoder.

func (*Encoder) Encode

func (e *Encoder) Encode(msg proto.Message) (int64, error)

Encode takes any proto.Message and streams it to the underlying writer. Messages are framed with a length prefix.

Jump to

Keyboard shortcuts

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