MCPcopy Create free account
hub / github.com/bytebase/bytebase / getGroup

Method getGroup

backend/api/directory-sync/webhook.go:872–882  ·  view source on GitHub ↗
(ctx context.Context, c *echo.Context)

Source from the content-addressed store, hash-verified

870}
871
872func (s *Service) getGroup(ctx context.Context, c *echo.Context) (*store.GroupMessage, error) {
873 groupName, err := decodeGroupIdentifier(c.Param("groupID"))
874 if err != nil {
875 return nil, errors.Errorf("failed to parse group %v, error %v", c.Param("groupID"), err)
876 }
877 group, err := s.store.GetGroupByName(ctx, c.Param("workspaceID"), common.FormatGroupEmail(groupName))
878 if err != nil {
879 return nil, errors.Errorf("failed to find group, error %v", err)
880 }
881 return group, nil
882}
883
884func decodeGroupIdentifier(groupID string) (string, error) {
885 identifier, err := url.QueryUnescape(groupID)

Callers 2

createGroupSliceFunction · 0.80

Calls 4

FormatGroupEmailFunction · 0.92
decodeGroupIdentifierFunction · 0.85
ErrorfMethod · 0.80
GetGroupByNameMethod · 0.80

Tested by

no test coverage detected