listGroups lists all the consumer groups See http://kafka.apache.org/protocol.html#The_Messages_ListGroups
(request listGroupsRequestV1)
| 426 | // |
| 427 | // See http://kafka.apache.org/protocol.html#The_Messages_ListGroups |
| 428 | func (c *Conn) listGroups(request listGroupsRequestV1) (listGroupsResponseV1, error) { |
| 429 | var response listGroupsResponseV1 |
| 430 | |
| 431 | err := c.readOperation( |
| 432 | func(deadline time.Time, id int32) error { |
| 433 | return c.writeRequest(listGroups, v1, id, request) |
| 434 | }, |
| 435 | func(deadline time.Time, size int) error { |
| 436 | return expectZeroSize(func() (remain int, err error) { |
| 437 | return (&response).readFrom(&c.rbuf, size) |
| 438 | }()) |
| 439 | }, |
| 440 | ) |
| 441 | if err != nil { |
| 442 | return listGroupsResponseV1{}, err |
| 443 | } |
| 444 | if response.ErrorCode != 0 { |
| 445 | return listGroupsResponseV1{}, Error(response.ErrorCode) |
| 446 | } |
| 447 | |
| 448 | return response, nil |
| 449 | } |
| 450 | |
| 451 | // offsetCommit commits the specified topic partition offsets |
| 452 | // |