MCPcopy Index your code
hub / github.com/dearcode/candy / LoadGroupList

Method LoadGroupList

client/candy.go:404–423  ·  view source on GitHub ↗

LoadGroupList 拉取群组列表

()

Source from the content-addressed store, hash-verified

402
403// LoadGroupList 拉取群组列表
404func (c *CandyClient) LoadGroupList() (string, error) {
405 req := &meta.GateLoadGroupListRequest{}
406 resp, err := c.api.LoadGroupList(context.Background(), req)
407 if err != nil {
408 return emptyString, err
409 }
410
411 var groups []*GroupInfo
412 for _, group := range resp.Groups {
413 groups = append(groups, &GroupInfo{ID: group.ID, Name: group.Name, Users: group.Users})
414 }
415
416 groupList := &GroupList{Groups: groups}
417 data, err := encodeJSON(groupList)
418 if err != nil {
419 return emptyString, err
420 }
421
422 return string(data), resp.Header.Error()
423}

Callers

nothing calls this directly

Calls 3

encodeJSONFunction · 0.85
LoadGroupListMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected