GetUserByID gets the user by ID.
(ctx context.Context, id int)
| 59 | |
| 60 | // GetUserByID gets the user by ID. |
| 61 | func (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. |
| 73 | func (s *Store) GetUserByEmail(ctx context.Context, email string) (*UserMessage, error) { |
no test coverage detected