Documentation
¶
Index ¶
- type SessionStore
- func (s *SessionStore) Create(ctx context.Context, userID string) (*core.Session, error)
- func (s *SessionStore) GetByRefreshToken(ctx context.Context, refreshToken string) (*core.Session, error)
- func (s *SessionStore) ListForUser(ctx context.Context, userID string) ([]core.Session, error)
- func (s *SessionStore) Revoke(ctx context.Context, sessionID string) error
- func (s *SessionStore) RevokeAllForUser(ctx context.Context, userID string) error
- type UserStore
- func (s *UserStore) Close() error
- func (s *UserStore) Create(ctx context.Context, email, passwordHash string) (*core.User, error)
- func (s *UserStore) Delete(ctx context.Context, id string) error
- func (s *UserStore) GetByEmail(ctx context.Context, email string) (*core.User, error)
- func (s *UserStore) GetByID(ctx context.Context, id string) (*core.User, error)
- func (s *UserStore) UpdateEmail(ctx context.Context, id, newEmail string) error
- func (s *UserStore) UpdatePassword(ctx context.Context, id, newPasswordHash string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionStore ¶
type SessionStore struct {
// contains filtered or unexported fields
}
SessionStore implements core.SessionStore in memory
func NewSessionStore ¶
func NewSessionStore() *SessionStore
NewSessionStore creates a new in-memory session store
func (*SessionStore) GetByRefreshToken ¶
func (s *SessionStore) GetByRefreshToken(ctx context.Context, refreshToken string) (*core.Session, error)
GetByRefreshToken retrieves a session by its refresh token
func (*SessionStore) ListForUser ¶
ListForUser returns all sessions for a user
func (*SessionStore) Revoke ¶
func (s *SessionStore) Revoke(ctx context.Context, sessionID string) error
Revoke removes a specific session
func (*SessionStore) RevokeAllForUser ¶
func (s *SessionStore) RevokeAllForUser(ctx context.Context, userID string) error
RevokeAllForUser removes all sessions for a user
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
UserStore implements core.userStore using in-memory map Good for testing and development
func (*UserStore) GetByEmail ¶
GetByEmail retrieves a user by email
func (*UserStore) UpdateEmail ¶
UpdateEmail changes a user's email
Click to show internal directories.
Click to hide internal directories.