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

Method encode

sync_group_request.go:59–96  ·  view source on GitHub ↗
(pe packetEncoder)

Source from the content-addressed store, hash-verified

57}
58
59func (s *SyncGroupRequest) encode(pe packetEncoder) (err error) {
60 if err := pe.putString(s.GroupId); err != nil {
61 return err
62 }
63
64 pe.putInt32(s.GenerationId)
65
66 if err := pe.putString(s.MemberId); err != nil {
67 return err
68 }
69
70 if s.Version >= 3 {
71 if err := pe.putNullableString(s.GroupInstanceId); err != nil {
72 return err
73 }
74 }
75
76 if s.Version >= 5 {
77 if err := pe.putNullableString(s.ProtocolType); err != nil {
78 return err
79 }
80 if err := pe.putNullableString(s.ProtocolName); err != nil {
81 return err
82 }
83 }
84
85 if err := pe.putArrayLength(len(s.GroupAssignments)); err != nil {
86 return err
87 }
88 for _, block := range s.GroupAssignments {
89 if err := block.encode(pe, s.Version); err != nil {
90 return err
91 }
92 }
93
94 pe.putEmptyTaggedFieldArray()
95 return nil
96}
97
98func (s *SyncGroupRequest) decode(pd packetDecoder, version int16) (err error) {
99 s.Version = version

Callers

nothing calls this directly

Calls 6

putStringMethod · 0.65
putInt32Method · 0.65
putNullableStringMethod · 0.65
putArrayLengthMethod · 0.65
encodeMethod · 0.65

Tested by

no test coverage detected