Documentation
¶
Index ¶
- type SQLAccountRepository
- func (r *SQLAccountRepository) Create(a *adapter.Account) error
- func (r *SQLAccountRepository) Delete(id string) error
- func (r *SQLAccountRepository) Exists(id string) bool
- func (r *SQLAccountRepository) Get(id string) (*adapter.Account, error)
- func (r *SQLAccountRepository) GetByEmail(email string) (*adapter.Account, error)
- func (r *SQLAccountRepository) GetByUsername(username string) (*adapter.Account, error)
- func (r *SQLAccountRepository) Update(a *adapter.Account) error
- type SQLPasswordResetTokenRepository
- func (r *SQLPasswordResetTokenRepository) Create(token *adapter.PasswordResetToken) error
- func (r *SQLPasswordResetTokenRepository) DeleteByUserID(userID string) error
- func (r *SQLPasswordResetTokenRepository) DeleteExpired() error
- func (r *SQLPasswordResetTokenRepository) GetByTokenHash(tokenHash string) (*adapter.PasswordResetToken, error)
- func (r *SQLPasswordResetTokenRepository) MarkAsUsed(tokenHash string) error
- type SQLRefreshTokenRepository
- func (r *SQLRefreshTokenRepository) Create(token *adapter.RefreshToken) error
- func (r *SQLRefreshTokenRepository) Delete(id string) error
- func (r *SQLRefreshTokenRepository) DeleteExpired() error
- func (r *SQLRefreshTokenRepository) GetByTokenHash(tokenHash string) (*adapter.RefreshToken, error)
- func (r *SQLRefreshTokenRepository) GetByUserID(userID string) ([]*adapter.RefreshToken, error)
- func (r *SQLRefreshTokenRepository) Revoke(tokenHash string) error
- func (r *SQLRefreshTokenRepository) RevokeAll(userID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLAccountRepository ¶
type SQLAccountRepository struct {
// contains filtered or unexported fields
}
SQLAccountRepository implements adapter.AccountRepository using SQL database
func NewSQLAccountRepository ¶
func NewSQLAccountRepository(db database.Database) *SQLAccountRepository
NewSQLAccountRepository creates a new SQL-based account repository
func (*SQLAccountRepository) Create ¶
func (r *SQLAccountRepository) Create(a *adapter.Account) error
Create creates a new account
func (*SQLAccountRepository) Delete ¶
func (r *SQLAccountRepository) Delete(id string) error
Delete deletes an account by ID
func (*SQLAccountRepository) Exists ¶
func (r *SQLAccountRepository) Exists(id string) bool
Exists checks if an account with the given ID exists
func (*SQLAccountRepository) Get ¶
func (r *SQLAccountRepository) Get(id string) (*adapter.Account, error)
Get retrieves an account by ID
func (*SQLAccountRepository) GetByEmail ¶
func (r *SQLAccountRepository) GetByEmail(email string) (*adapter.Account, error)
GetByEmail retrieves an account by email
func (*SQLAccountRepository) GetByUsername ¶
func (r *SQLAccountRepository) GetByUsername(username string) (*adapter.Account, error)
GetByUsername retrieves an account by username
type SQLPasswordResetTokenRepository ¶
type SQLPasswordResetTokenRepository struct {
// contains filtered or unexported fields
}
SQLPasswordResetTokenRepository implements adapter.PasswordResetTokenRepository using SQL database
func NewSQLPasswordResetTokenRepository ¶
func NewSQLPasswordResetTokenRepository(db database.Database) *SQLPasswordResetTokenRepository
NewSQLPasswordResetTokenRepository creates a new SQL-based password reset token repository
func (*SQLPasswordResetTokenRepository) Create ¶
func (r *SQLPasswordResetTokenRepository) Create(token *adapter.PasswordResetToken) error
Create stores a new password reset token
func (*SQLPasswordResetTokenRepository) DeleteByUserID ¶
func (r *SQLPasswordResetTokenRepository) DeleteByUserID(userID string) error
DeleteByUserID removes all password reset tokens for a user
func (*SQLPasswordResetTokenRepository) DeleteExpired ¶
func (r *SQLPasswordResetTokenRepository) DeleteExpired() error
DeleteExpired removes all expired tokens
func (*SQLPasswordResetTokenRepository) GetByTokenHash ¶
func (r *SQLPasswordResetTokenRepository) GetByTokenHash(tokenHash string) (*adapter.PasswordResetToken, error)
GetByTokenHash retrieves a password reset token by its hash
func (*SQLPasswordResetTokenRepository) MarkAsUsed ¶
func (r *SQLPasswordResetTokenRepository) MarkAsUsed(tokenHash string) error
MarkAsUsed marks a password reset token as used
type SQLRefreshTokenRepository ¶
type SQLRefreshTokenRepository struct {
// contains filtered or unexported fields
}
SQLRefreshTokenRepository implements adapter.RefreshTokenRepository using SQL database
func NewSQLRefreshTokenRepository ¶
func NewSQLRefreshTokenRepository(db database.Database) *SQLRefreshTokenRepository
NewSQLRefreshTokenRepository creates a new SQL-based refresh token repository
func (*SQLRefreshTokenRepository) Create ¶
func (r *SQLRefreshTokenRepository) Create(token *adapter.RefreshToken) error
Create stores a new refresh token
func (*SQLRefreshTokenRepository) Delete ¶
func (r *SQLRefreshTokenRepository) Delete(id string) error
Delete removes a specific token
func (*SQLRefreshTokenRepository) DeleteExpired ¶
func (r *SQLRefreshTokenRepository) DeleteExpired() error
DeleteExpired removes all expired tokens
func (*SQLRefreshTokenRepository) GetByTokenHash ¶
func (r *SQLRefreshTokenRepository) GetByTokenHash(tokenHash string) (*adapter.RefreshToken, error)
GetByTokenHash retrieves a refresh token by its hash
func (*SQLRefreshTokenRepository) GetByUserID ¶
func (r *SQLRefreshTokenRepository) GetByUserID(userID string) ([]*adapter.RefreshToken, error)
GetByUserID retrieves all refresh tokens for a user
func (*SQLRefreshTokenRepository) Revoke ¶
func (r *SQLRefreshTokenRepository) Revoke(tokenHash string) error
Revoke marks a refresh token as revoked
func (*SQLRefreshTokenRepository) RevokeAll ¶
func (r *SQLRefreshTokenRepository) RevokeAll(userID string) error
RevokeAll revokes all refresh tokens for a user