MCPcopy Create free account
hub / github.com/PatchMon/PatchMon / GetByID

Method GetByID

server-source-code/internal/store/sessions.go:173–181  ·  view source on GitHub ↗

GetByID returns a session by ID and user ID.

(ctx context.Context, id, userID string)

Source from the content-addressed store, hash-verified

171
172// GetByID returns a session by ID and user ID.
173func (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.
184func (s *SessionsStore) ListByUserID(ctx context.Context, userID string) ([]models.UserSession, error) {

Callers

nothing calls this directly

Calls 3

dbUserSessionToModelFunction · 0.85
DBMethod · 0.65
GetSessionByIDMethod · 0.65

Tested by

no test coverage detected