framing

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2017 License: Apache-2.0 Imports: 1 Imported by: 6 modules, 20 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxSize = 4 << 20 // 4MB

MaxSize is the maximum decodable message size.

Variables

View Source
var (
	// ErrSize is returned by Decode calls when a message would exceed the maximum
	// allowed size.
	ErrSize = fmt.Errorf("proto: message exceeds %dMB", MaxSize>>20)
)

Functions

This section is empty.

Types

type Decoder

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

Decoder reads and decodes Protobuf messages from an io.Reader.

func NewDecoder

func NewDecoder(r Reader, uf UnmarshalFunc) *Decoder

NewDecoder returns a new Decoder that reads from the given io.Reader. If r does not also implement StringReader, it will be wrapped in a bufio.Reader.

func (*Decoder) Decode

func (d *Decoder) Decode(m interface{}) error

Decode reads the next Protobuf-encoded message from its input and stores it in the value pointed to by m. If m isn't a proto.Message, Decode will panic.

type Reader

type Reader interface {
	ReadFrame(buf []byte) (endOfFrame bool, n int, err error)
}

type UnmarshalFunc

type UnmarshalFunc func([]byte, interface{}) error

UnmarshalFunc translates bytes to objects

Jump to

Keyboard shortcuts

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