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

Method leaveGroup

conn.go:402–423  ·  view source on GitHub ↗

leaveGroup leaves the consumer from the consumer group See http://kafka.apache.org/protocol.html#The_Messages_LeaveGroup

(request leaveGroupRequestV0)

Source from the content-addressed store, hash-verified

400//
401// See http://kafka.apache.org/protocol.html#The_Messages_LeaveGroup
402func (c *Conn) leaveGroup(request leaveGroupRequestV0) (leaveGroupResponseV0, error) {
403 var response leaveGroupResponseV0
404
405 err := c.writeOperation(
406 func(deadline time.Time, id int32) error {
407 return c.writeRequest(leaveGroup, v0, id, request)
408 },
409 func(deadline time.Time, size int) error {
410 return expectZeroSize(func() (remain int, err error) {
411 return (&response).readFrom(&c.rbuf, size)
412 }())
413 },
414 )
415 if err != nil {
416 return leaveGroupResponseV0{}, err
417 }
418 if response.ErrorCode != 0 {
419 return leaveGroupResponseV0{}, Error(response.ErrorCode)
420 }
421
422 return response, nil
423}
424
425// listGroups lists all the consumer groups
426//

Callers

nothing calls this directly

Calls 5

writeOperationMethod · 0.95
writeRequestMethod · 0.95
expectZeroSizeFunction · 0.85
ErrorTypeAlias · 0.70
readFromMethod · 0.45

Tested by

no test coverage detected