Documentation ¶
Index ¶
- Variables
- func AppendVarint(b []byte, v uint64) []byte
- func CloneVTSlice[S ~[]E, E CloneVT[E]](s S) S
- 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 EncodeVarint(dAtA []byte, offset int, v uint64) int
- func IsEqualVT[T EqualVT[T]](t1, t2 T) bool
- func IsEqualVTSlice[S ~[]E, E EqualVT[E]](s1, s2 S) bool
- func SizeOfVarint(x uint64) (n int)
- func SizeOfZigzag(x uint64) (n int)
- func Skip(dAtA []byte) (n int, err error)
- type CloneMessage
- type CloneVT
- type EqualVT
- type Message
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 CloneVTSlice ¶ added in v0.6.2
func CloneVTSlice[S ~[]E, E CloneVT[E]](s S) S
CloneVTSlice clones a slice of CloneVT messages.
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 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 IsEqualVTSlice ¶ added in v0.6.2
IsEqualVTSlice checks if two slices of EqualVT messages are equal.
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.
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 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.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
protoc-gen-go-lite
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. |
features
|
|
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. |
flags
Package flags provides a set of flags controlled by build tags.
|
Package flags provides a set of flags controlled by build tags. |
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
|
|