(pe packetEncoder)
| 25 | } |
| 26 | |
| 27 | func (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 | |
| 52 | func (r *OffsetCommitResponse) decode(pd packetDecoder, version int16) (err error) { |
| 53 | r.Version = version |
nothing calls this directly
no test coverage detected