package protolazy
Import Path
google.golang.org/protobuf/internal/protolazy (on go.dev)
Dependency Relation
imports 8 packages, and imported by 2 packages
Involved Source Files
bufferreader.go
Package protolazy contains internal data structures for lazy message decoding.
pointer_unsafe.go
Package-Level Type Names (total 3)
BufferReader is a structure encapsulating a protobuf and a current position
Buf []byte
Pos int
decodeVarint decodes a varint at the current position
decodeVarint32 decodes a varint32 at the current position
(*BufferReader) DecodeVarintSlow() (x uint64, err error)
Done returns whether we are at the end of the protobuf
Remaining returns how many bytes remain
skip skips the specified number of bytes
skipBytes skips a set of bytes
skipFixed32 skips a fixed32
skipFixed64 skips a fixed64
skipGroup skips a group with the specified tag. It executes efficiently using a tag stack
skipValue skips a value in the protobuf, based on the specified tag
skipVarint effiently skips a varint
func NewBufferReader(buf []byte) BufferReader
IndexEntry is the structure for an index of the fields in a message of a
proto (not descending to sub-messages)
first byte after a contiguous sequence of bytes for this tag/field, which could
include a single encoding of the field, or multiple encodings for the field
FieldNum uint32
True if this protobuf segment includes multiple encodings of the field
first byte of this tag/field
func (*XXX_lazyUnmarshalInfo).FindFieldInProto(fieldNum uint32) (start, end uint32, found, multipleContiguous bool, multipleEntries []IndexEntry)
func (*XXX_lazyUnmarshalInfo).SetIndex(index []IndexEntry)
XXX_lazyUnmarshalInfo has information about a particular lazily decoded message
Deprecated: Do not use. This will be deleted in the near future.
The protobuf associated with this lazily decoded message. It is
only set during proto.Unmarshal(). It doesn't need to be set and
loaded atomically, since any simultaneous set (Unmarshal) and read
(during a get) would already be a race in the app code.
AllowedPartial returns true if the user originally unmarshalled this message with
AllowPartial set to true
(*XXX_lazyUnmarshalInfo) AppendField(b []byte, num uint32) ([]byte, bool)
Buffer returns the lazy unmarshal buffer.
Deprecated: Do not use. This will be deleted in the near future.
FindFieldInProto looks for field fieldNum in lazyUnmarshalInfo information
(including protobuf), returns startOffset/endOffset/found.
SetBuffer sets the lazy unmarshal buffer.
Deprecated: Do not use. This will be deleted in the near future.
(*XXX_lazyUnmarshalInfo) SetIndex(index []IndexEntry)
SetUnmarshalFlags is called to set a copy of the original unmarshalInputFlags.
The flags should reflect how Unmarshal was called.
(*XXX_lazyUnmarshalInfo) SizeField(num uint32) (size int)
UnmarshalFlags returns the original unmarshalInputFlags.
Package-Level Functions (only one)
NewBufferReader creates a new BufferRead from a protobuf
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |