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

Method encode

add_partitions_to_txn_response.go:18–41  ·  view source on GitHub ↗
(pe packetEncoder)

Source from the content-addressed store, hash-verified

16}
17
18func (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
43func (a *AddPartitionsToTxnResponse) decode(pd packetDecoder, version int16) (err error) {
44 a.Version = version

Callers

nothing calls this directly

Calls 5

putDurationMsMethod · 0.65
putArrayLengthMethod · 0.65
putStringMethod · 0.65
encodeMethod · 0.65

Tested by

no test coverage detected