protoio

package
v0.34.13 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 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

This section is empty.

Variables

This section is empty.

Functions

func MarshalDelimited

func MarshalDelimited(msg proto.Message) ([]byte, error)

func UnmarshalDelimited

func UnmarshalDelimited(data []byte, msg proto.Message) error

Types

type ReadCloser

type ReadCloser interface {
	Reader
	io.Closer
}

func NewDelimitedReader

func NewDelimitedReader(r io.Reader, maxSize int) ReadCloser

NewDelimitedReader reads varint-delimited Protobuf messages from a reader. Unlike the gogoproto NewDelimitedReader, this does not buffer the reader, which may cause poor performance but is necessary when only reading single messages (e.g. in the p2p package). It also returns the number of bytes read, which is necessary for the p2p package.

type Reader

type Reader interface {
	ReadMsg(msg proto.Message) (int, error)
}

type WriteCloser

type WriteCloser interface {
	Writer
	io.Closer
}

func NewDelimitedWriter

func NewDelimitedWriter(w io.Writer) WriteCloser

NewDelimitedWriter writes a varint-delimited Protobuf message to a writer. It is equivalent to the gogoproto NewDelimitedWriter, except WriteMsg() also returns the number of bytes written, which is necessary in the p2p package.

type Writer

type Writer interface {
	WriteMsg(proto.Message) (int, error)
}

Jump to

Keyboard shortcuts

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