Versions in this module Expand all Collapse all v1 v1.0.1 Jun 30, 2026 v1.0.0 Jun 30, 2026 Changes in this version + const MaxFieldNumber + const MaxMessageSize + const MaxVarintLen32 + const MaxVarintLen64 + const MinFieldNumber + var ErrGroupDepthExceeded = errors.New("wire: group nesting depth exceeded") + var ErrInvalidFieldNumber = errors.New("wire: invalid field number") + var ErrInvalidWireType = errors.New("wire: invalid wire type") + var ErrMessageTooLarge = errors.New("wire: message size exceeds 2 GiB limit") + var ErrOverflow = errors.New("wire: varint overflow") + var ErrTruncated = errors.New("wire: unexpected end of input") + func AppendBytes(b []byte, data []byte) []byte + func AppendFixed32(b []byte, v uint32) []byte + func AppendFixed64(b []byte, v uint64) []byte + func AppendFloat32(b []byte, v float32) []byte + func AppendFloat64(b []byte, v float64) []byte + func AppendString(b []byte, s string) []byte + func AppendTag(b []byte, fieldNumber uint32, wireType WireType) []byte + func AppendVarint(b []byte, v uint64) []byte + func ConsumeBytes(b []byte) (data []byte, bytesConsumed int) + func ConsumeField(wireType WireType, b []byte) int + func ConsumeFixed32(b []byte) (uint32, int) + func ConsumeFixed64(b []byte) (uint64, int) + func ConsumeFloat32(b []byte) (float32, int) + func ConsumeFloat64(b []byte) (float64, int) + func ConsumeString(b []byte) (string, int) + func ConsumeVarint(b []byte) (value uint64, bytesConsumed int) + func DecodeZigZag32(v uint32) int32 + func DecodeZigZag64(v uint64) int64 + func EncodeTag(fieldNumber uint32, wireType WireType) uint64 + func EncodeZigZag32(v int32) uint32 + func EncodeZigZag64(v int64) uint64 + func ParseError(n int) error + func SizeBytes(dataLen int) int + func SizeTag(fieldNumber uint32) int + func SizeVarint(v uint64) int + type BytesCodec interface + AppendBytes func([]byte, []byte) []byte + AppendString func([]byte, string) []byte + ConsumeBytes func([]byte) ([]byte, int) + ConsumeString func([]byte) (string, int) + SizeBytes func(int) int + type Codec struct + func NewCodec() *Codec + func (c *Codec) AppendBytes(b []byte, data []byte) []byte + func (c *Codec) AppendFixed32(b []byte, v uint32) []byte + func (c *Codec) AppendFixed64(b []byte, v uint64) []byte + func (c *Codec) AppendFloat32(b []byte, v float32) []byte + func (c *Codec) AppendFloat64(b []byte, v float64) []byte + func (c *Codec) AppendString(b []byte, s string) []byte + func (c *Codec) AppendTag(b []byte, fieldNumber uint32, wireType WireType) []byte + func (c *Codec) AppendVarint(b []byte, v uint64) []byte + func (c *Codec) ConsumeBytes(b []byte) ([]byte, int) + func (c *Codec) ConsumeFixed32(b []byte) (uint32, int) + func (c *Codec) ConsumeFixed64(b []byte) (uint64, int) + func (c *Codec) ConsumeFloat32(b []byte) (float32, int) + func (c *Codec) ConsumeFloat64(b []byte) (float64, int) + func (c *Codec) ConsumeString(b []byte) (string, int) + func (c *Codec) ConsumeTag(b []byte) (uint32, WireType, int) + func (c *Codec) ConsumeVarint(b []byte) (uint64, int) + func (c *Codec) DecodeTag(tag uint64) (uint32, WireType) + func (c *Codec) DecodeZigZag32(v uint32) int32 + func (c *Codec) DecodeZigZag64(v uint64) int64 + func (c *Codec) EncodeTag(fieldNumber uint32, wireType WireType) uint64 + func (c *Codec) EncodeZigZag32(v int32) uint32 + func (c *Codec) EncodeZigZag64(v int64) uint64 + func (c *Codec) SizeBytes(dataLen int) int + func (c *Codec) SizeTag(fieldNumber uint32) int + func (c *Codec) SizeVarint(v uint64) int + type FixedCodec interface + AppendFixed32 func([]byte, uint32) []byte + AppendFixed64 func([]byte, uint64) []byte + AppendFloat32 func([]byte, float32) []byte + AppendFloat64 func([]byte, float64) []byte + ConsumeFixed32 func([]byte) (uint32, int) + ConsumeFixed64 func([]byte) (uint64, int) + ConsumeFloat32 func([]byte) (float32, int) + ConsumeFloat64 func([]byte) (float64, int) + type TagCodec interface + AppendTag func([]byte, uint32, WireType) []byte + ConsumeTag func([]byte) (uint32, WireType, int) + DecodeTag func(uint64) (uint32, WireType) + EncodeTag func(uint32, WireType) uint64 + SizeTag func(uint32) int + type VarintCodec interface + AppendVarint func([]byte, uint64) []byte + ConsumeVarint func([]byte) (uint64, int) + SizeVarint func(uint64) int + type WireType int8 + const WireBytes + const WireEndGroup + const WireFixed32 + const WireFixed64 + const WireStartGroup + const WireVarint + func ConsumeTag(b []byte) (fieldNumber uint32, wireType WireType, bytesConsumed int) + func DecodeTag(tag uint64) (fieldNumber uint32, wireType WireType) + func (wt WireType) String() string + func (wt WireType) Valid() bool + type ZigZagCodec interface + DecodeZigZag32 func(uint32) int32 + DecodeZigZag64 func(uint64) int64 + EncodeZigZag32 func(int32) uint32 + EncodeZigZag64 func(int64) uint64