repository

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TOTPRepository

type TOTPRepository struct {
	// contains filtered or unexported fields
}

func NewTOTPRepository

func NewTOTPRepository(db bun.IDB) *TOTPRepository

func (*TOTPRepository) CompareAndSwapBackupCodes

func (r *TOTPRepository) CompareAndSwapBackupCodes(ctx context.Context, userID, expectedBackupCodes, newBackupCodes string) (bool, error)

func (*TOTPRepository) Create

func (r *TOTPRepository) Create(ctx context.Context, userID, secret, backupCodes string) (*types.TOTPRecord, error)

func (*TOTPRepository) CreateTrustedDevice

func (r *TOTPRepository) CreateTrustedDevice(ctx context.Context, userID, token, userAgent string, expiresAt time.Time) (*types.TrustedDevice, error)

func (*TOTPRepository) DeleteByUserID

func (r *TOTPRepository) DeleteByUserID(ctx context.Context, userID string) error

func (*TOTPRepository) DeleteExpiredTrustedDevices

func (r *TOTPRepository) DeleteExpiredTrustedDevices(ctx context.Context) error

func (*TOTPRepository) DeleteTrustedDevicesByUserID

func (r *TOTPRepository) DeleteTrustedDevicesByUserID(ctx context.Context, userID string) error

func (*TOTPRepository) GetByUserID

func (r *TOTPRepository) GetByUserID(ctx context.Context, userID string) (*types.TOTPRecord, error)

func (*TOTPRepository) GetTrustedDeviceByToken

func (r *TOTPRepository) GetTrustedDeviceByToken(ctx context.Context, token string) (*types.TrustedDevice, error)

func (*TOTPRepository) IsEnabled

func (r *TOTPRepository) IsEnabled(ctx context.Context, userID string) (bool, error)

func (*TOTPRepository) RefreshTrustedDevice

func (r *TOTPRepository) RefreshTrustedDevice(ctx context.Context, token string, expiresAt time.Time) error

func (*TOTPRepository) SetEnabled

func (r *TOTPRepository) SetEnabled(ctx context.Context, userID string, enabled bool) error

func (*TOTPRepository) UpdateBackupCodes

func (r *TOTPRepository) UpdateBackupCodes(ctx context.Context, userID, backupCodes string) error

func (*TOTPRepository) WithTx

func (r *TOTPRepository) WithTx(tx bun.IDB) *TOTPRepository

Jump to

Keyboard shortcuts

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