MCPcopy Index your code
hub / github.com/bytebase/bytebase / FindWorkspace

Method FindWorkspace

backend/store/workspace.go:266–275  ·  view source on GitHub ↗

FindWorkspace finds a single workspace matching the filter. Returns (nil, nil) if no workspace matches.

(ctx context.Context, find *FindWorkspaceMessage)

Source from the content-addressed store, hash-verified

264// FindWorkspace finds a single workspace matching the filter.
265// Returns (nil, nil) if no workspace matches.
266func (s *Store) FindWorkspace(ctx context.Context, find *FindWorkspaceMessage) (*WorkspaceMessage, error) {
267 workspaces, err := s.ListWorkspacesByEmail(ctx, find)
268 if err != nil {
269 return nil, err
270 }
271 if len(workspaces) == 0 {
272 return nil, nil
273 }
274 return workspaces[0], nil
275}
276
277// ListWorkspacesByEmail finds all workspaces where the given email is a member
278// in the workspace IAM policy bindings, either directly or via a group.

Callers

nothing calls this directly

Calls 1

ListWorkspacesByEmailMethod · 0.95

Tested by

no test coverage detected