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

Method encode

offset_commit_response.go:27–50  ·  view source on GitHub ↗
(pe packetEncoder)

Source from the content-addressed store, hash-verified

25}
26
27func (r *OffsetCommitResponse) encode(pe packetEncoder) error {
28 if r.Version >= 3 {
29 pe.putInt32(r.ThrottleTimeMs)
30 }
31 if err := pe.putArrayLength(len(r.Errors)); err != nil {
32 return err
33 }
34 for topic, partitions := range r.Errors {
35 if err := pe.putString(topic); err != nil {
36 return err
37 }
38 if err := pe.putArrayLength(len(partitions)); err != nil {
39 return err
40 }
41 for partition, kerror := range partitions {
42 pe.putInt32(partition)
43 pe.putKError(kerror)
44 pe.putEmptyTaggedFieldArray()
45 }
46 pe.putEmptyTaggedFieldArray()
47 }
48 pe.putEmptyTaggedFieldArray()
49 return nil
50}
51
52func (r *OffsetCommitResponse) decode(pd packetDecoder, version int16) (err error) {
53 r.Version = version

Callers

nothing calls this directly

Calls 5

putInt32Method · 0.65
putArrayLengthMethod · 0.65
putStringMethod · 0.65
putKErrorMethod · 0.65

Tested by

no test coverage detected