proto

package
v0.0.0-...-80bddaf Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MaxPoolSize = 64 * 1024 // 64KB

MaxPoolSize defines the largest buffer size we'll keep in the pool.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode(msg proto.Message) error

Decode decodes a proto message from the underlying reader.

func (*Decoder) DecodeWithSizePrefix

func (d *Decoder) DecodeWithSizePrefix(msg proto.Message) error

DecodeWithSizePrefix decodes a proto message from the underlying reader with a size prefix.

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode(msg proto.Message) (n int, err error)

Encode encodes the given proto message and writes it to the underlying writer.

func (*Encoder) EncodeSize

func (e *Encoder) EncodeSize(msg proto.Message) int

EncodeSize returns the size in bytes that the encoded message will take

func (*Encoder) EncodeWithSizePrefix

func (e *Encoder) EncodeWithSizePrefix(msg proto.Message) (n int, err error)

EncodeWithSizePrefix encodes the given proto message and writes it to the underlying writer with a size prefix.

Jump to

Keyboard shortcuts

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