Documentation ¶
Overview ¶
Package protohelpers provides helper functions for encoding and decoding protobuf messages. The spec can be found at https://protobuf.dev/programming-guides/encoding/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidLength is returned when decoding a negative length. ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") // ErrIntOverflow is returned when decoding a varint representation of an integer that overflows 64 bits. ErrIntOverflow = fmt.Errorf("proto: integer overflow") // ErrUnexpectedEndOfGroup is returned when decoding a group end without a corresponding group start. ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
Functions ¶
func EncodeVarint ¶
EncodeVarint encodes a uint64 into a varint-encoded byte slice and returns the offset of the encoded value. The provided offset is the offset after the last byte of the encoded value.
func SizeOfVarint ¶
SizeOfVarint returns the size of the varint-encoded value.
func SizeOfZigzag ¶
SizeOfZigzag returns the size of the zigzag-encoded value.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.