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

Method encode

fetch_request.go:20–35  ·  view source on GitHub ↗
(pe packetEncoder, version int16)

Source from the content-addressed store, hash-verified

18}
19
20func (b *fetchRequestBlock) encode(pe packetEncoder, version int16) error {
21 b.Version = version
22 if b.Version >= 9 {
23 pe.putInt32(b.currentLeaderEpoch)
24 }
25 pe.putInt64(b.fetchOffset)
26 if b.Version >= 12 {
27 pe.putInt32(b.lastFetchedEpoch)
28 }
29 if b.Version >= 5 {
30 pe.putInt64(b.logStartOffset)
31 }
32 pe.putInt32(b.maxBytes)
33 pe.putEmptyTaggedFieldArray()
34 return nil
35}
36
37func (b *fetchRequestBlock) decode(pd packetDecoder, version int16) (err error) {
38 b.Version = version

Callers

nothing calls this directly

Calls 3

putInt32Method · 0.65
putInt64Method · 0.65

Tested by

no test coverage detected