package protohelpers
import "github.com/planetscale/vtprotobuf/protohelpers"
Package protohelpers provides helper functions for encoding and decoding protobuf messages. The spec can be found at https://protobuf.dev/programming-guides/encoding/.
Index ¶
- Variables
- func EncodeVarint(dAtA []byte, offset int, v uint64) int
- func SizeOfVarint(x uint64) (n int)
- func SizeOfZigzag(x uint64) (n int)
- func Skip(dAtA []byte) (n int, err error)
Variables ¶
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.
func Skip ¶
Skip the first record of the byte slice and return the offset of the next record.
Source Files ¶
- Version
- v0.6.0 (latest)
- Published
- Jan 29, 2024
- Platform
- windows/amd64
- Imports
- 3 packages
- Last checked
- 3 days ago –
Tools for package owners.