(pe packetEncoder)
| 16 | } |
| 17 | |
| 18 | func (a *AddPartitionsToTxnResponse) encode(pe packetEncoder) error { |
| 19 | pe.putDurationMs(a.ThrottleTime) |
| 20 | if err := pe.putArrayLength(len(a.Errors)); err != nil { |
| 21 | return err |
| 22 | } |
| 23 | |
| 24 | for topic, e := range a.Errors { |
| 25 | if err := pe.putString(topic); err != nil { |
| 26 | return err |
| 27 | } |
| 28 | if err := pe.putArrayLength(len(e)); err != nil { |
| 29 | return err |
| 30 | } |
| 31 | for _, partitionError := range e { |
| 32 | if err := partitionError.encode(pe); err != nil { |
| 33 | return err |
| 34 | } |
| 35 | } |
| 36 | pe.putEmptyTaggedFieldArray() |
| 37 | } |
| 38 | |
| 39 | pe.putEmptyTaggedFieldArray() |
| 40 | return nil |
| 41 | } |
| 42 | |
| 43 | func (a *AddPartitionsToTxnResponse) decode(pd packetDecoder, version int16) (err error) { |
| 44 | a.Version = version |
nothing calls this directly
no test coverage detected