repository

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

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

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

func (*SQLAccountRepository) Update

func (r *SQLAccountRepository) Update(a *adapter.Account) error

Update updates an existing account

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

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL