protocodec

package
v3.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package protocodec provides utilities for encoding and decoding protobuf messages into files.

Protobuf messages are prepended with their size as a uvarint so they can be streamed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r streamio.Reader, pb proto.Message) error

Decode decodes a message encoded with protocodec from r and stores it in pb.

func Encode

func Encode(w streamio.Writer, pb proto.Message) error

Encode encodes a protobuf message into w. Encoded messages can be decoded with Decode.

func Size

func Size(pb proto.Message) int

Size returns the number of bytes that would be required to call Encode for pb.

Types

This section is empty.

Jump to

Keyboard shortcuts

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