MCPcopy Create free account
hub / github.com/IBM/sarama / encode

Method encode

txn_offset_commit_request.go:188–202  ·  view source on GitHub ↗
(pe packetEncoder, version int16)

Source from the content-addressed store, hash-verified

186}
187
188func (p *PartitionOffsetMetadata) encode(pe packetEncoder, version int16) error {
189 pe.putInt32(p.Partition)
190 pe.putInt64(p.Offset)
191
192 if version >= 2 {
193 pe.putInt32(p.LeaderEpoch)
194 }
195
196 if err := pe.putNullableString(p.Metadata); err != nil {
197 return err
198 }
199
200 pe.putEmptyTaggedFieldArray()
201 return nil
202}
203
204func (p *PartitionOffsetMetadata) decode(pd packetDecoder, version int16) (err error) {
205 if p.Partition, err = pd.getInt32(); err != nil {

Callers

nothing calls this directly

Calls 4

putInt32Method · 0.65
putInt64Method · 0.65
putNullableStringMethod · 0.65

Tested by

no test coverage detected