protobuf

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: BSD-3-Clause Imports: 7 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("timeout")

Functions

func NewWriterAndReader

func NewWriterAndReader(s p2p.Stream) (Writer, Reader)

Types

type Message

type Message = proto.Message

func ReadMessages

func ReadMessages(r io.Reader, newMessage func() Message) (m []Message, err error)

type Reader

type Reader struct {
	ggio.Reader
}

func NewReader

func NewReader(r io.Reader) Reader

func (Reader) ReadMsgWithContext

func (r Reader) ReadMsgWithContext(ctx context.Context, msg proto.Message) error

func (Reader) ReadMsgWithTimeout

func (r Reader) ReadMsgWithTimeout(d time.Duration, msg proto.Message) error

type Writer

type Writer struct {
	ggio.Writer
}

func NewWriter

func NewWriter(w io.Writer) Writer

func (Writer) WriteMsgWithContext

func (w Writer) WriteMsgWithContext(ctx context.Context, msg proto.Message) error

func (Writer) WriteMsgWithTimeout

func (w Writer) WriteMsgWithTimeout(d time.Duration, msg proto.Message) error

Directories

Path Synopsis
internal
pb
Package pb holds only Protocol Buffer definitions and generated code for testing purposes.
Package pb holds only Protocol Buffer definitions and generated code for testing purposes.

Jump to

Keyboard shortcuts

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