MCPcopy Create free account
hub / github.com/CrowdStrike/csproto / NewEncoder

Function NewEncoder

encoder.go:17–22  ·  view source on GitHub ↗

NewEncoder initializes a new Protobuf encoder to write to the specified buffer, which must be pre-allocated by the caller with sufficient space to hold the message(s) being written.

(p []byte)

Source from the content-addressed store, hash-verified

15// NewEncoder initializes a new Protobuf encoder to write to the specified buffer, which must be
16// pre-allocated by the caller with sufficient space to hold the message(s) being written.
17func NewEncoder(p []byte) *Encoder {
18 return &Encoder{
19 p: p,
20 offset: 0,
21 }
22}
23
24// EncodeBool writes a varint-encoded boolean value to the buffer preceded by the varint-encoded tag key.
25func (e *Encoder) EncodeBool(tag int, v bool) {

Callers 15

BenchmarkEncodeStringFunction · 0.92
TestEncodeBoolFunction · 0.92
TestEncodePackedBoolFunction · 0.92
TestEncodeStringFunction · 0.92
TestEncodeBytesFunction · 0.92
TestEncodeInt32Function · 0.92
TestEncodePackedInt32Function · 0.92
TestEncodeInt64Function · 0.92
TestEncodePackedInt64Function · 0.92
TestEncodeUInt32Function · 0.92
TestEncodePackedUInt32Function · 0.92
TestEncodeUInt64Function · 0.92

Calls

no outgoing calls

Tested by 15

BenchmarkEncodeStringFunction · 0.74
TestEncodeBoolFunction · 0.74
TestEncodePackedBoolFunction · 0.74
TestEncodeStringFunction · 0.74
TestEncodeBytesFunction · 0.74
TestEncodeInt32Function · 0.74
TestEncodePackedInt32Function · 0.74
TestEncodeInt64Function · 0.74
TestEncodePackedInt64Function · 0.74
TestEncodeUInt32Function · 0.74
TestEncodePackedUInt32Function · 0.74
TestEncodeUInt64Function · 0.74