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

Method DeleteGroups

deletegroups.go:37–60  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

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.
37func (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}

Callers 1

TestClientDeleteGroupsFunction · 0.80

Calls 3

roundTripMethod · 0.95
makeDurationFunction · 0.85
makeErrorFunction · 0.85

Tested by 1

TestClientDeleteGroupsFunction · 0.64