MCPcopy
hub / github.com/segmentio/kafka-go / readFrom

Method readFrom

syncgroup.go:185–205  ·  view source on GitHub ↗
(r *bufio.Reader, size int)

Source from the content-addressed store, hash-verified

183}
184
185func (t *groupAssignment) readFrom(r *bufio.Reader, size int) (remain int, err error) {
186 // I came across this case when testing for compatibility with bsm/sarama-cluster. It
187 // appears in some cases, sarama-cluster can send a nil array entry. Admittedly, I
188 // didn't look too closely at it.
189 if size == 0 {
190 t.Topics = map[string][]int32{}
191 return 0, nil
192 }
193
194 if remain, err = readInt16(r, size, &t.Version); err != nil {
195 return
196 }
197 if remain, err = readMapStringInt32(r, remain, &t.Topics); err != nil {
198 return
199 }
200 if remain, err = readBytes(r, remain, &t.UserData); err != nil {
201 return
202 }
203
204 return
205}
206
207func (t groupAssignment) bytes() []byte {
208 buf := bytes.NewBuffer(nil)

Callers

nothing calls this directly

Calls 3

readMapStringInt32Function · 0.85
readBytesFunction · 0.85
readInt16Function · 0.70

Tested by

no test coverage detected