Documentation
¶
Index ¶
- Variables
- func AppendVarint(b []byte, v uint64) []byte
- func CloneBytes[S ~[]byte](v S) S
- func CloneBytesMap[M ~map[K]V, K comparable, V ~[]byte](m M) M
- func CloneBytesSlice[S ~[]E, E ~[]byte](s S) S
- func CloneMap[M ~map[K]V, K comparable, V any](m M) M
- func ClonePtr[T any](v *T) *T
- func CloneSlice[S ~[]E, E any](s S) S
- func CloneVTMap[M ~map[K]V, K comparable, V CloneVT[V]](m M) M
- func CloneVTSlice[S ~[]E, E CloneVT[E]](s S) S
- func CloneVTValue[T CloneVT[T]](v T) T
- func CompareComparable[T comparable]() func(t1, t2 T) bool
- func CompareEqualVT[T EqualVT[T]]() func(t1, t2 T) bool
- func ConsumeVarint(b []byte) (v uint64, n int)
- func DecodeBytes(b []byte, idx int, cp bool) ([]byte, int, error)
- func DecodeBytesAppend(dst []byte, b []byte, idx int) ([]byte, int, error)
- func DecodeFixed32(b []byte, idx int) (uint32, int, error)
- func DecodeFixed64(b []byte, idx int) (uint64, int, error)
- func DecodeFloat32(b []byte, idx int) (float32, int, error)
- func DecodeFloat64(b []byte, idx int) (float64, int, error)
- func DecodeLengthDelimited(b []byte, idx int) (int, int, error)
- func DecodeSint32(b []byte, idx int) (int32, int, error)
- func DecodeSint64(b []byte, idx int) (int64, int, error)
- func DecodeString(b []byte, idx int) (string, int, error)
- func DecodeStringUnsafe(b []byte, idx int) (string, int, error)
- func DecodeVarint(b []byte, idx int) (uint64, int, error)
- func DecodeVarintBool(b []byte, idx int) (bool, int, error)
- func DecodeVarintInt32(b []byte, idx int) (int32, int, error)
- func DecodeVarintInt64(b []byte, idx int) (int64, int, error)
- func DecodeVarintUint32(b []byte, idx int) (uint32, int, error)
- func EncodeBool(dAtA []byte, offset int, v bool) int
- func EncodeBytes[S ~[]byte](dAtA []byte, offset int, v S) int
- func EncodeFixed32(dAtA []byte, offset int, v uint32) int
- func EncodeFixed64(dAtA []byte, offset int, v uint64) int
- func EncodeRawBytes[S ~[]byte](dAtA []byte, offset int, v S) int
- func EncodeString[S ~string](dAtA []byte, offset int, v S) int
- func EncodeVarint(dAtA []byte, offset int, v uint64) int
- func EncodeVarintPacked[S ~[]E, E marshalVarintNumber](dAtA []byte, offset int, vals S) int
- func EncodeZigzag32[T ~int32](dAtA []byte, offset int, v T) int
- func EncodeZigzag32Packed[S ~[]E, E ~int32](dAtA []byte, offset int, vals S) int
- func EncodeZigzag64[T ~int64](dAtA []byte, offset int, v T) int
- func EncodeZigzag64Packed[S ~[]E, E ~int64](dAtA []byte, offset int, vals S) int
- func EqualBytes(a, b []byte) bool
- func EqualBytesMap[M ~map[K]V, K comparable, V ~[]byte](a, b M) bool
- func EqualBytesPresent(a, b []byte) bool
- func EqualBytesSlice[S ~[]E, E ~[]byte](a, b S) bool
- func EqualMap[M ~map[K]V, K comparable, V comparable](a, b M) bool
- func EqualPtr[T comparable](a, b *T) bool
- func EqualSlice[S ~[]E, E comparable](a, b S) bool
- func EqualVTImplicit[T EqualVT[T]](a, b T, empty func() T) bool
- func EqualVTMapImplicit[M ~map[K]V, K comparable, V EqualVT[V]](a, b M, empty func() V) bool
- func EqualVTSliceImplicit[S ~[]E, E EqualVT[E]](a, b S, empty func() E) bool
- func IsEqualVT[T EqualVT[T]](t1, t2 T) bool
- func IsEqualVTSlice[S ~[]E, E EqualVT[E]](s1, s2 S) bool
- func PackedFixedElementCount(b []byte, width int) int
- func PackedVarintElementCount(b []byte) (n int)
- func SizeBoolNonZero(keySize int, v bool) int
- func SizeBoolPacked(keySize int, vals []bool) int
- func SizeBoolPtr(keySize int, v *bool) int
- func SizeBoolSlice(keySize int, vals []bool) int
- func SizeBoolValue(keySize int) int
- func SizeBytesNonEmpty(keySize int, v []byte) int
- func SizeBytesPresent(keySize int, v []byte) int
- func SizeBytesSlice[S ~[]E, E ~[]byte](keySize int, vals S) (n int)
- func SizeBytesValue(keySize, l int) int
- func SizeFixed32NonZero[T sizeFixed32Number](keySize int, v T) int
- func SizeFixed32Packed[S ~[]E, E sizeFixed32Number](keySize int, vals S) int
- func SizeFixed32Ptr[T sizeFixed32Number](keySize int, v *T) int
- func SizeFixed32Slice[S ~[]E, E sizeFixed32Number](keySize int, vals S) int
- func SizeFixed32Value(keySize int) int
- func SizeFixed64NonZero[T sizeFixed64Number](keySize int, v T) int
- func SizeFixed64Packed[S ~[]E, E sizeFixed64Number](keySize int, vals S) int
- func SizeFixed64Ptr[T sizeFixed64Number](keySize int, v *T) int
- func SizeFixed64Slice[S ~[]E, E sizeFixed64Number](keySize int, vals S) int
- func SizeFixed64Value(keySize int) int
- func SizeGroup(keySize, msgSize int) int
- func SizeMessage(keySize, msgSize int) int
- func SizeOfVarint(x uint64) (n int)
- func SizeOfZigzag(x uint64) (n int)
- func SizeStringNonEmpty(keySize int, v string) int
- func SizeStringPtr(keySize int, v *string) int
- func SizeStringSlice[S ~[]E, E ~string](keySize int, vals S) (n int)
- func SizeStringValue(keySize int, v string) int
- func SizeVarintNonZero[T sizeVarintNumber](keySize int, v T) int
- func SizeVarintPacked[S ~[]E, E sizeVarintNumber](keySize int, vals S) int
- func SizeVarintPtr[T sizeVarintNumber](keySize int, v *T) int
- func SizeVarintSlice[S ~[]E, E sizeVarintNumber](keySize int, vals S) (n int)
- func SizeVarintValue[T sizeVarintNumber](keySize int, v T) int
- func SizeZigzagNonZero[T sizeZigzagNumber](keySize int, v T) int
- func SizeZigzagPacked[S ~[]E, E sizeZigzagNumber](keySize int, vals S) int
- func SizeZigzagPtr[T sizeZigzagNumber](keySize int, v *T) int
- func SizeZigzagSlice[S ~[]E, E sizeZigzagNumber](keySize int, vals S) (n int)
- func SizeZigzagValue[T sizeZigzagNumber](keySize int, v T) int
- func Skip(dAtA []byte) (n int, err error)
- func SkipWithin(dAtA []byte, idx, limit int) (int, error)
- func TextFinishMessage(sb *TextBuilder) string
- func TextSortedMapKeys[M ~map[K]V, K cmp.Ordered, V any](m M) []K
- func TextStartMessage(sb *TextBuilder, name string) int
- func TextWriteBool(sb *TextBuilder, v bool)
- func TextWriteBytes[B ~[]byte](sb *TextBuilder, v B)
- func TextWriteFieldPrefix(sb *TextBuilder, initialLen int, name string)
- func TextWriteFloat32(sb *TextBuilder, v float32)
- func TextWriteFloat64(sb *TextBuilder, v float64)
- func TextWriteInt[T ~int32 | ~int64](sb *TextBuilder, v T)
- func TextWriteListEnd(sb *TextBuilder)
- func TextWriteListSeparator(sb *TextBuilder, index int)
- func TextWriteListStart(sb *TextBuilder, initialLen int, name string)
- func TextWriteMapEnd(sb *TextBuilder)
- func TextWriteMapEntryPrefix(sb *TextBuilder)
- func TextWriteMapKeyValueSeparator(sb *TextBuilder)
- func TextWriteMapStart(sb *TextBuilder, initialLen int, name string)
- func TextWriteString(sb *TextBuilder, v string)
- func TextWriteStringer[T interface{ ... }](sb *TextBuilder, v T)
- func TextWriteTextMarshaler(sb *TextBuilder, v TextMarshaler)
- func TextWriteUint[T ~uint32 | ~uint64](sb *TextBuilder, v T)
- type CloneMessage
- type CloneVT
- type EqualVT
- type JSONMessage
- type Message
- type TextBuilder
- type TextMarshaler
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidLength is returned when decoding a negative length. ErrInvalidLength = errors.New("proto: negative length found during unmarshaling") // ErrIntOverflow is returned when decoding a varint representation of an integer that overflows 64 bits. ErrIntOverflow = errors.New("proto: integer overflow") // ErrUnexpectedEndOfGroup is returned when decoding a group end without a corresponding group start. ErrUnexpectedEndOfGroup = errors.New("proto: unexpected end of group") )
Functions ¶
func AppendVarint ¶ added in v0.4.7
AppendVarint appends v to b as a varint-encoded uint64.
func CloneBytes ¶ added in v0.15.0
func CloneBytes[S ~[]byte](v S) S
CloneBytes clones one byte slice.
func CloneBytesMap ¶ added in v0.15.0
func CloneBytesMap[M ~map[K]V, K comparable, V ~[]byte](m M) M
CloneBytesMap clones a map whose values are bytes fields.
func CloneBytesSlice ¶ added in v0.15.0
func CloneBytesSlice[S ~[]E, E ~[]byte](s S) S
CloneBytesSlice clones a repeated bytes field.
func CloneMap ¶ added in v0.15.0
func CloneMap[M ~map[K]V, K comparable, V any](m M) M
CloneMap clones a map whose values do not need deep cloning.
func ClonePtr ¶ added in v0.15.0
func ClonePtr[T any](v *T) *T
ClonePtr clones one explicit scalar pointer.
func CloneSlice ¶ added in v0.15.0
func CloneSlice[S ~[]E, E any](s S) S
CloneSlice clones a scalar slice.
func CloneVTMap ¶ added in v0.15.0
func CloneVTMap[M ~map[K]V, K comparable, V CloneVT[V]](m M) M
CloneVTMap clones a map whose values are VT messages.
func CloneVTSlice ¶ added in v0.6.2
func CloneVTSlice[S ~[]E, E CloneVT[E]](s S) S
CloneVTSlice clones a slice of CloneVT messages.
func CloneVTValue ¶ added in v0.15.0
func CloneVTValue[T CloneVT[T]](v T) T
CloneVTValue clones one VT message value.
func CompareComparable ¶
func CompareComparable[T comparable]() func(t1, t2 T) bool
CompareComparable returns a compare function to compare two comparable types.
func CompareEqualVT ¶
CompareEqualVT returns a compare function to compare two VTProtobuf messages.
func ConsumeVarint ¶ added in v0.4.7
ConsumeVarint parses b as a varint-encoded uint64, reporting its length. This returns -1 upon any error, -1 for parse error and -2 for overflow.
func DecodeBytes ¶ added in v0.12.0
DecodeBytes decodes a length-prefixed byte slice. If copy is false, returns a sub-slice. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeBytesAppend ¶ added in v0.15.0
DecodeBytesAppend decodes a length-prefixed byte slice into dst and returns the new offset. It preserves generated singular bytes behavior by reusing dst and making empty values non-nil.
func DecodeFixed32 ¶ added in v0.12.0
DecodeFixed32 decodes a fixed 32-bit value. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeFixed64 ¶ added in v0.12.0
DecodeFixed64 decodes a fixed 64-bit value. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeFloat32 ¶ added in v0.12.0
DecodeFloat32 decodes a 32-bit float. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeFloat64 ¶ added in v0.12.0
DecodeFloat64 decodes a 64-bit float. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeLengthDelimited ¶ added in v0.15.0
DecodeLengthDelimited decodes a length-delimited payload and returns its start and end offsets. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeSint32 ¶ added in v0.12.0
DecodeSint32 decodes a zigzag-encoded sint32. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeSint64 ¶ added in v0.12.0
DecodeSint64 decodes a zigzag-encoded sint64. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeString ¶ added in v0.12.0
DecodeString decodes a length-prefixed string (with copy). Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeStringUnsafe ¶ added in v0.12.0
DecodeStringUnsafe decodes a length-prefixed string without copying. The returned string shares memory with the input slice. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeVarint ¶ added in v0.12.0
DecodeVarint decodes a varint at the given index, returning value, new index, and error. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeVarintBool ¶ added in v0.12.0
DecodeVarintBool decodes a varint as bool. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeVarintInt32 ¶ added in v0.12.0
DecodeVarintInt32 decodes a varint as int32. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeVarintInt64 ¶ added in v0.12.0
DecodeVarintInt64 decodes a varint as int64. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeVarintUint32 ¶ added in v0.12.0
DecodeVarintUint32 decodes a varint as uint32. Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func EncodeBool ¶ added in v0.15.0
EncodeBool writes a bool value before offset and returns the new offset.
func EncodeBytes ¶ added in v0.15.0
EncodeBytes writes a length-delimited byte slice before offset and returns the new offset.
func EncodeFixed32 ¶ added in v0.15.0
EncodeFixed32 writes a fixed-width 32-bit value before offset and returns the new offset.
func EncodeFixed64 ¶ added in v0.15.0
EncodeFixed64 writes a fixed-width 64-bit value before offset and returns the new offset.
func EncodeRawBytes ¶ added in v0.15.0
EncodeRawBytes writes raw bytes before offset and returns the new offset.
func EncodeString ¶ added in v0.15.0
EncodeString writes a length-delimited string before offset and returns the new offset.
func EncodeVarint ¶ added in v0.2.5
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 EncodeVarintPacked ¶ added in v0.15.0
EncodeVarintPacked writes packed varint values before offset and returns the new offset.
func EncodeZigzag32 ¶ added in v0.15.0
EncodeZigzag32 writes a zigzag-encoded 32-bit value before offset and returns the new offset.
func EncodeZigzag32Packed ¶ added in v0.15.0
EncodeZigzag32Packed writes packed zigzag-encoded 32-bit values before offset and returns the new offset.
func EncodeZigzag64 ¶ added in v0.15.0
EncodeZigzag64 writes a zigzag-encoded 64-bit value before offset and returns the new offset.
func EncodeZigzag64Packed ¶ added in v0.15.0
EncodeZigzag64Packed writes packed zigzag-encoded 64-bit values before offset and returns the new offset.
func EqualBytes ¶ added in v0.15.0
EqualBytes compares two implicit bytes values.
func EqualBytesMap ¶ added in v0.15.0
func EqualBytesMap[M ~map[K]V, K comparable, V ~[]byte](a, b M) bool
EqualBytesMap compares maps whose values are bytes fields.
func EqualBytesPresent ¶ added in v0.15.0
EqualBytesPresent compares two explicit bytes values where nil and empty differ.
func EqualBytesSlice ¶ added in v0.15.0
EqualBytesSlice compares repeated bytes values.
func EqualMap ¶ added in v0.15.0
func EqualMap[M ~map[K]V, K comparable, V comparable](a, b M) bool
EqualMap compares maps with comparable values.
func EqualPtr ¶ added in v0.15.0
func EqualPtr[T comparable](a, b *T) bool
EqualPtr compares two explicit scalar pointers.
func EqualSlice ¶ added in v0.15.0
func EqualSlice[S ~[]E, E comparable](a, b S) bool
EqualSlice compares repeated comparable values.
func EqualVTImplicit ¶ added in v0.15.0
EqualVTImplicit compares VT messages where nil is equivalent to an empty message.
func EqualVTMapImplicit ¶ added in v0.15.0
func EqualVTMapImplicit[M ~map[K]V, K comparable, V EqualVT[V]](a, b M, empty func() V) bool
EqualVTMapImplicit compares map VT values where nil values are empty messages.
func EqualVTSliceImplicit ¶ added in v0.15.0
EqualVTSliceImplicit compares repeated VT messages where nil elements are empty messages.
func IsEqualVTSlice ¶ added in v0.6.2
IsEqualVTSlice checks if two slices of EqualVT messages are equal.
func PackedFixedElementCount ¶ added in v0.15.0
PackedFixedElementCount returns the number of fixed-width elements in a packed payload.
func PackedVarintElementCount ¶ added in v0.15.0
PackedVarintElementCount returns the number of varint elements in a packed payload.
func SizeBoolNonZero ¶ added in v0.15.0
SizeBoolNonZero returns the encoded field size for one implicit bool value.
func SizeBoolPacked ¶ added in v0.15.0
SizeBoolPacked returns the encoded field size for packed repeated bool values.
func SizeBoolPtr ¶ added in v0.15.0
SizeBoolPtr returns the encoded field size for one explicit bool value.
func SizeBoolSlice ¶ added in v0.15.0
SizeBoolSlice returns the encoded field size for unpacked repeated bool values.
func SizeBoolValue ¶ added in v0.15.0
SizeBoolValue returns the encoded field size for one present bool value.
func SizeBytesNonEmpty ¶ added in v0.15.0
SizeBytesNonEmpty returns the encoded field size for one implicit bytes value.
func SizeBytesPresent ¶ added in v0.15.0
SizeBytesPresent returns the encoded field size for one explicit bytes value.
func SizeBytesSlice ¶ added in v0.15.0
SizeBytesSlice returns the encoded field size for repeated bytes values.
func SizeBytesValue ¶ added in v0.15.0
SizeBytesValue returns the encoded field size for one present length-delimited value.
func SizeFixed32NonZero ¶ added in v0.15.0
SizeFixed32NonZero returns the encoded field size for one implicit fixed32 value.
func SizeFixed32Packed ¶ added in v0.15.0
SizeFixed32Packed returns the encoded field size for packed repeated fixed32 values.
func SizeFixed32Ptr ¶ added in v0.15.0
SizeFixed32Ptr returns the encoded field size for one explicit fixed32 value.
func SizeFixed32Slice ¶ added in v0.15.0
SizeFixed32Slice returns the encoded field size for unpacked repeated fixed32 values.
func SizeFixed32Value ¶ added in v0.15.0
SizeFixed32Value returns the encoded field size for one present fixed32 value.
func SizeFixed64NonZero ¶ added in v0.15.0
SizeFixed64NonZero returns the encoded field size for one implicit fixed64 value.
func SizeFixed64Packed ¶ added in v0.15.0
SizeFixed64Packed returns the encoded field size for packed repeated fixed64 values.
func SizeFixed64Ptr ¶ added in v0.15.0
SizeFixed64Ptr returns the encoded field size for one explicit fixed64 value.
func SizeFixed64Slice ¶ added in v0.15.0
SizeFixed64Slice returns the encoded field size for unpacked repeated fixed64 values.
func SizeFixed64Value ¶ added in v0.15.0
SizeFixed64Value returns the encoded field size for one present fixed64 value.
func SizeMessage ¶ added in v0.15.0
SizeMessage returns the encoded field size for one length-delimited message or map entry.
func SizeOfVarint ¶ added in v0.2.5
SizeOfVarint returns the size of the varint-encoded value.
func SizeOfZigzag ¶ added in v0.2.5
SizeOfZigzag returns the size of the zigzag-encoded value.
func SizeStringNonEmpty ¶ added in v0.15.0
SizeStringNonEmpty returns the encoded field size for one implicit string value.
func SizeStringPtr ¶ added in v0.15.0
SizeStringPtr returns the encoded field size for one explicit string value.
func SizeStringSlice ¶ added in v0.15.0
SizeStringSlice returns the encoded field size for repeated strings.
func SizeStringValue ¶ added in v0.15.0
SizeStringValue returns the encoded field size for one present string value.
func SizeVarintNonZero ¶ added in v0.15.0
SizeVarintNonZero returns the encoded field size for one implicit varint value.
func SizeVarintPacked ¶ added in v0.15.0
SizeVarintPacked returns the encoded field size for packed repeated varints.
func SizeVarintPtr ¶ added in v0.15.0
SizeVarintPtr returns the encoded field size for one explicit varint value.
func SizeVarintSlice ¶ added in v0.15.0
SizeVarintSlice returns the encoded field size for unpacked repeated varints.
func SizeVarintValue ¶ added in v0.15.0
SizeVarintValue returns the encoded field size for one present varint value.
func SizeZigzagNonZero ¶ added in v0.15.0
SizeZigzagNonZero returns the encoded field size for one implicit zigzag value.
func SizeZigzagPacked ¶ added in v0.15.0
SizeZigzagPacked returns the encoded field size for packed repeated zigzags.
func SizeZigzagPtr ¶ added in v0.15.0
SizeZigzagPtr returns the encoded field size for one explicit zigzag value.
func SizeZigzagSlice ¶ added in v0.15.0
SizeZigzagSlice returns the encoded field size for unpacked repeated zigzags.
func SizeZigzagValue ¶ added in v0.15.0
SizeZigzagValue returns the encoded field size for one present zigzag value.
func Skip ¶ added in v0.2.5
Skip the first record of the byte slice and return the offset of the next record.
func SkipWithin ¶ added in v0.15.0
SkipWithin skips one encoded field at idx and verifies it stays within limit.
func TextFinishMessage ¶ added in v0.15.0
func TextFinishMessage(sb *TextBuilder) string
TextFinishMessage writes the closing message delimiter and returns the final text.
func TextSortedMapKeys ¶ added in v0.15.0
TextSortedMapKeys returns sorted keys for deterministic generated proto text maps.
func TextStartMessage ¶ added in v0.15.0
func TextStartMessage(sb *TextBuilder, name string) int
TextStartMessage writes the opening message label and returns its initial length.
func TextWriteBool ¶ added in v0.15.0
func TextWriteBool(sb *TextBuilder, v bool)
TextWriteBool writes a bool proto text value.
func TextWriteBytes ¶ added in v0.15.0
func TextWriteBytes[B ~[]byte](sb *TextBuilder, v B)
TextWriteBytes writes a quoted base64 proto text bytes value.
func TextWriteFieldPrefix ¶ added in v0.15.0
func TextWriteFieldPrefix(sb *TextBuilder, initialLen int, name string)
TextWriteFieldPrefix writes the optional separator, field name, and value separator.
func TextWriteFloat32 ¶ added in v0.15.0
func TextWriteFloat32(sb *TextBuilder, v float32)
TextWriteFloat32 writes a float32 proto text value.
func TextWriteFloat64 ¶ added in v0.15.0
func TextWriteFloat64(sb *TextBuilder, v float64)
TextWriteFloat64 writes a float64 proto text value.
func TextWriteInt ¶ added in v0.15.0
func TextWriteInt[T ~int32 | ~int64](sb *TextBuilder, v T)
TextWriteInt writes a signed integer proto text value.
func TextWriteListEnd ¶ added in v0.15.0
func TextWriteListEnd(sb *TextBuilder)
TextWriteListEnd writes the repeated field closing delimiter.
func TextWriteListSeparator ¶ added in v0.15.0
func TextWriteListSeparator(sb *TextBuilder, index int)
TextWriteListSeparator writes the separator before non-first repeated values.
func TextWriteListStart ¶ added in v0.15.0
func TextWriteListStart(sb *TextBuilder, initialLen int, name string)
TextWriteListStart writes a repeated field prefix and opening delimiter.
func TextWriteMapEnd ¶ added in v0.15.0
func TextWriteMapEnd(sb *TextBuilder)
TextWriteMapEnd writes the map field closing delimiter.
func TextWriteMapEntryPrefix ¶ added in v0.15.0
func TextWriteMapEntryPrefix(sb *TextBuilder)
TextWriteMapEntryPrefix writes the separator before one sorted map entry.
func TextWriteMapKeyValueSeparator ¶ added in v0.15.0
func TextWriteMapKeyValueSeparator(sb *TextBuilder)
TextWriteMapKeyValueSeparator writes the separator between a map key and value.
func TextWriteMapStart ¶ added in v0.15.0
func TextWriteMapStart(sb *TextBuilder, initialLen int, name string)
TextWriteMapStart writes a map field prefix and opening delimiter.
func TextWriteString ¶ added in v0.15.0
func TextWriteString(sb *TextBuilder, v string)
TextWriteString writes a quoted string proto text value.
func TextWriteStringer ¶ added in v0.15.0
func TextWriteStringer[T interface{ String() string }](sb *TextBuilder, v T)
TextWriteStringer writes a quoted String value.
func TextWriteTextMarshaler ¶ added in v0.15.0
func TextWriteTextMarshaler(sb *TextBuilder, v TextMarshaler)
TextWriteTextMarshaler writes a nested proto text marshaler value.
func TextWriteUint ¶ added in v0.15.0
func TextWriteUint[T ~uint32 | ~uint64](sb *TextBuilder, v T)
TextWriteUint writes an unsigned integer proto text value.
Types ¶
type CloneMessage ¶ added in v0.4.8
type CloneMessage interface {
// Message extends the base message type.
Message
// CloneMessageVT clones the object.
CloneMessageVT() CloneMessage
}
CloneMessage is a message with a CloneMessage function.
type CloneVT ¶ added in v0.4.8
type CloneVT[T comparable] interface { comparable // CloneMessage is the non-generic clone interface. CloneMessage // CloneVT clones the object. CloneVT() T }
CloneVT is a message with a CloneVT function (VTProtobuf).
type EqualVT ¶
type EqualVT[T comparable] interface { comparable // EqualVT compares against the other message for equality. EqualVT(other T) bool }
EqualVT is a message with a EqualVT function (VTProtobuf).
type JSONMessage ¶ added in v0.9.0
type JSONMessage interface {
// MarshalJSON marshals the message to JSON.
MarshalJSON() ([]byte, error)
// UnmarshalJSON unmarshals the message from JSON.
UnmarshalJSON(data []byte) error
}
JSONMessage is a message with MarshalJSON and UnmarshalJSON.
type Message ¶
type Message interface {
// SizeVT returns the size of the message when marshaled.
SizeVT() int
// MarshalToSizedBufferVT marshals to a buffer that already is SizeVT bytes long.
MarshalToSizedBufferVT(dAtA []byte) (int, error)
// MarshalVT marshals the message with vtprotobuf.
MarshalVT() ([]byte, error)
// UnmarshalVT unmarshals the message object with vtprotobuf.
UnmarshalVT(data []byte) error
// Reset resets the message.
Reset()
}
Message is the base vtprotobuf message marshal/unmarshal interface.
type TextBuilder ¶ added in v0.15.0
TextBuilder is the builder used by generated proto text marshalers.
type TextMarshaler ¶ added in v0.15.0
type TextMarshaler interface {
MarshalProtoText() string
}
TextMarshaler is a message with a MarshalProtoText function.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
protoc-gen-go-lite
command
The protoc-gen-go-lite binary is a protoc plugin to generate Go code for both proto2 and proto3 versions of the protocol buffer language.
|
The protoc-gen-go-lite binary is a protoc plugin to generate Go code for both proto2 and proto3 versions of the protocol buffer language. |
|
compiler
|
|
|
protogen
Package protogen provides support for writing protoc plugins.
|
Package protogen provides support for writing protoc plugins. |
|
protogenlite
Package protogenlite provides a minimal protoc plugin model for generators that only need file/service/method metadata and Go import qualification.
|
Package protogenlite provides a minimal protoc plugin model for generators that only need file/service/method metadata and Go import qualification. |
|
encoding
|
|
|
protowire
Package protowire parses and formats the raw wire encoding.
|
Package protowire parses and formats the raw wire encoding. |
|
features
|
|
|
fieldsem
Package fieldsem resolves protobuf descriptors to generated Go field representation semantics.
|
Package fieldsem resolves protobuf descriptors to generated Go field representation semantics. |
|
internal
|
|
|
detrand
Package detrand provides deterministically random functionality.
|
Package detrand provides deterministically random functionality. |
|
editiondefaults
Package editiondefaults contains the binary representation of the editions defaults.
|
Package editiondefaults contains the binary representation of the editions defaults. |
|
editionssupport
Package editionssupport defines constants for editions that are supported.
|
Package editionssupport defines constants for editions that are supported. |
|
encoding/defval
Package defval marshals and unmarshals textual forms of default values.
|
Package defval marshals and unmarshals textual forms of default values. |
|
encoding/tag
Package tag marshals and unmarshals the legacy struct tags as generated by historical versions of protoc-gen-go.
|
Package tag marshals and unmarshals the legacy struct tags as generated by historical versions of protoc-gen-go. |
|
encoding/text
Package text implements the text format for protocol buffers.
|
Package text implements the text format for protocol buffers. |
|
errors
Package errors implements functions to manipulate errors.
|
Package errors implements functions to manipulate errors. |
|
genid
Package genid contains constants for declarations in descriptor.proto and the well-known types.
|
Package genid contains constants for declarations in descriptor.proto and the well-known types. |
|
order
Package order provides ordered access to messages and maps.
|
Package order provides ordered access to messages and maps. |
|
pragma
Package pragma provides types that can be embedded into a struct to statically enforce or prevent certain language properties.
|
Package pragma provides types that can be embedded into a struct to statically enforce or prevent certain language properties. |
|
protobuild
Package protobuild constructs messages.
|
Package protobuild constructs messages. |
|
set
Package set provides simple set data structures for uint64s.
|
Package set provides simple set data structures for uint64s. |
|
strs
Package strs provides string manipulation functionality specific to protobuf.
|
Package strs provides string manipulation functionality specific to protobuf. |
|
version
Package version records versioning information about this module.
|
Package version records versioning information about this module. |
|
weakdeps
Package weakdeps exists to add weak module dependencies.
|
Package weakdeps exists to add weak module dependencies. |
|
testproto
|
|
|
types
|
|