GetByID returns a session by ID and user ID.
(ctx context.Context, id, userID string)
| 171 | |
| 172 | // GetByID returns a session by ID and user ID. |
| 173 | func (s *SessionsStore) GetByID(ctx context.Context, id, userID string) (*models.UserSession, error) { |
| 174 | d := s.db.DB(ctx) |
| 175 | u, err := d.Queries.GetSessionByID(ctx, db.GetSessionByIDParams{ID: id, UserID: userID}) |
| 176 | if err != nil { |
| 177 | return nil, err |
| 178 | } |
| 179 | out := dbUserSessionToModel(u) |
| 180 | return &out, nil |
| 181 | } |
| 182 | |
| 183 | // ListByUserID returns all sessions for a user. |
| 184 | func (s *SessionsStore) ListByUserID(ctx context.Context, userID string) ([]models.UserSession, error) { |
nothing calls this directly
no test coverage detected