Involved Source Filesbufferreader.go Package protolazy contains internal data structures for lazy message decoding.pointer_unsafe.go
Package-Level Type Names (total 3, all are exported)
/* sort exporteds by: | */
BufferReader is a structure encapsulating a protobuf and a current positionBuf[]bytePosint 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 fieldFieldNumuint32 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 atomicLoadIndex(p **[]IndexEntry) *[]IndexEntry
func buildIndex(buf []byte) ([]IndexEntry, error)
func lookupField(indexp *[]IndexEntry, fieldNum uint32) (start, end uint32, found bool, multipleContiguous bool, multipleEntries []IndexEntry)
func (*XXX_lazyUnmarshalInfo).SetIndex(index []IndexEntry)
func atomicLoadIndex(p **[]IndexEntry) *[]IndexEntry
func atomicStoreIndex(p **[]IndexEntry, v *[]IndexEntry)
func atomicStoreIndex(p **[]IndexEntry, v *[]IndexEntry)
func lookupField(indexp *[]IndexEntry, fieldNum uint32) (start, end uint32, found bool, multipleContiguous bool, multipleEntries []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. Index of fields and their positions in the protobuf for this
message. Make index be a pointer to a slice so it can be updated
atomically. The index pointer is only set once (lazily when/if
the index is first needed), and must always be SET and LOADED
ATOMICALLY. The flags present when Unmarshal was originally called for this particular message 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.
func google.golang.org/protobuf/internal/impl.(*MessageInfo).unmarshalField(b []byte, p impl.pointer, f *impl.coderFieldInfo, lazyInfo *XXX_lazyUnmarshalInfo, flags piface.UnmarshalInputFlags) error
Package-Level Functions (total 6, in which 1 is exported)
NewBufferReader creates a new BufferRead from a protobuf
buildIndex builds an index of the specified protobuf, return the index
array and an error.
lookupField returns the offset at which the indicated field starts using
the index, offset immediately after field ends (including all instances of
a repeated field), and bools indicating if field was found and if there
are multiple encodings of the field in the byte range.
To hande the uncommon case where there are repeated encodings for the same
field which are not consecutive in the protobuf (so we need to returns
multiple start/end offsets), we also return a slice multipleEntries. If
multipleEntries is non-nil, then multiple entries were found, and the
values in the slice should be used, rather than start/end/found.