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

Method GetUserByID

backend/store/principal.go:61–70  ·  view source on GitHub ↗

GetUserByID gets the user by ID.

(ctx context.Context, id int)

Source from the content-addressed store, hash-verified

59
60// GetUserByID gets the user by ID.
61func (s *Store) GetUserByID(ctx context.Context, id int) (*UserMessage, error) {
62 users, err := s.ListUsers(ctx, &FindUserMessage{ID: &id})
63 if err != nil {
64 return nil, err
65 }
66 if len(users) == 0 {
67 return nil, nil
68 }
69 return users[0], nil
70}
71
72// GetUserByEmail gets the user by email.
73func (s *Store) GetUserByEmail(ctx context.Context, email string) (*UserMessage, error) {

Callers 3

getUserMethod · 0.80
getGroupMemberMethod · 0.80

Calls 1

ListUsersMethod · 0.95

Tested by

no test coverage detected