MCPcopy
hub / github.com/IBM/sarama / encode

Method encode

offset_commit_request.go:22–38  ·  view source on GitHub ↗
(pe packetEncoder, version int16)

Source from the content-addressed store, hash-verified

20}
21
22func (b *offsetCommitRequestBlock) encode(pe packetEncoder, version int16) error {
23 pe.putInt64(b.offset)
24 if version == 1 {
25 pe.putInt64(b.timestamp)
26 } else if b.timestamp != 0 {
27 Logger.Println("Non-zero timestamp specified for OffsetCommitRequest not v1, it will be ignored")
28 }
29 if version >= 6 {
30 pe.putInt32(b.committedLeaderEpoch)
31 }
32
33 if err := pe.putString(b.metadata); err != nil {
34 return err
35 }
36 pe.putEmptyTaggedFieldArray()
37 return nil
38}
39
40func (b *offsetCommitRequestBlock) decode(pd packetDecoder, version int16) (err error) {
41 if b.offset, err = pd.getInt64(); err != nil {

Callers

nothing calls this directly

Calls 5

putInt64Method · 0.65
PrintlnMethod · 0.65
putInt32Method · 0.65
putStringMethod · 0.65

Tested by

no test coverage detected