DeleteGroups sends a delete groups request and returns the response. The request is sent to the group coordinator of the first group of the request. All deleted groups must be managed by the same group coordinator.
( ctx context.Context, req *DeleteGroupsRequest, )
| 35 | // DeleteGroups sends a delete groups request and returns the response. The request is sent to the group coordinator of the first group |
| 36 | // of the request. All deleted groups must be managed by the same group coordinator. |
| 37 | func (c *Client) DeleteGroups( |
| 38 | ctx context.Context, |
| 39 | req *DeleteGroupsRequest, |
| 40 | ) (*DeleteGroupsResponse, error) { |
| 41 | m, err := c.roundTrip(ctx, req.Addr, &deletegroups.Request{ |
| 42 | GroupIDs: req.GroupIDs, |
| 43 | }) |
| 44 | if err != nil { |
| 45 | return nil, fmt.Errorf("kafka.(*Client).DeleteGroups: %w", err) |
| 46 | } |
| 47 | |
| 48 | r := m.(*deletegroups.Response) |
| 49 | |
| 50 | ret := &DeleteGroupsResponse{ |
| 51 | Throttle: makeDuration(r.ThrottleTimeMs), |
| 52 | Errors: make(map[string]error, len(r.Responses)), |
| 53 | } |
| 54 | |
| 55 | for _, t := range r.Responses { |
| 56 | ret.Errors[t.GroupID] = makeError(t.ErrorCode, "") |
| 57 | } |
| 58 | |
| 59 | return ret, nil |
| 60 | } |