Documentation ¶
Index ¶
- Constants
- type AccountRepo
- func (r *AccountRepo) AddRole(ctx context.Context, role *account.Role) error
- func (r *AccountRepo) AddUser(ctx context.Context, user *account.User) error
- func (r *AccountRepo) CountStaleSignInAttemptLogs(ctx context.Context, validWindowStart time.Time) (int, error)
- func (r *AccountRepo) CountUsers(ctx context.Context) (int, error)
- func (r *AccountRepo) CountUsersByRoleID(ctx context.Context, roleID int) (int, error)
- func (r *AccountRepo) DeleteStaleSignInAttemptLogs(ctx context.Context, validWindowStart time.Time) error
- func (r *AccountRepo) FindRecoveryCodesByUserID(ctx context.Context, userID int) ([][]byte, error)
- func (r *AccountRepo) FindRoleByID(ctx context.Context, roleID int) (*account.Role, error)
- func (r *AccountRepo) FindRoleByName(ctx context.Context, name string) (*account.Role, error)
- func (r *AccountRepo) FindRoles(ctx context.Context, sortTopID int) ([]*account.Role, int, error)
- func (r *AccountRepo) FindRolesByUserID(ctx context.Context, userID int) ([]*account.Role, error)
- func (r *AccountRepo) FindRolesPageBySearch(ctx context.Context, page, size, sortTopID int, sorts []string, search string) ([]*account.Role, int, error)
- func (r *AccountRepo) FindSignInAttemptLogByEmail(ctx context.Context, email string) (*account.SignInAttemptLog, error)
- func (r *AccountRepo) FindUserByEmail(ctx context.Context, email string) (*account.User, error)
- func (r *AccountRepo) FindUserByID(ctx context.Context, id int) (*account.User, error)
- func (r *AccountRepo) FindUsersPageBySearch(ctx context.Context, page, size, sortTopID int, sorts []string, search string) ([]*account.User, int, error)
- func (r *AccountRepo) RemoveRole(ctx context.Context, roleID int) error
- func (r *AccountRepo) SaveRole(ctx context.Context, role *account.Role) error
- func (r *AccountRepo) SaveSignInAttemptLog(ctx context.Context, log *account.SignInAttemptLog) error
- func (r *AccountRepo) SaveUser(ctx context.Context, user *account.User) error
- type Conn
- func (c *Conn) BeginExclusiveTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Conn) BeginImmediateTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Conn) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Conn) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (c *Conn) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (c *Conn) QueryContext(ctx context.Context, query string, args ...any) (*Rows, error)
- func (c *Conn) QueryRowContext(ctx context.Context, query string, args ...any) *Row
- type DB
- func (db *DB) Begin() (*Tx, error)
- func (db *DB) BeginExclusiveTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (db *DB) BeginImmediateTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (db *DB) Conn(ctx context.Context) (*Conn, error)
- func (db *DB) Exec(query string, args ...any) (sql.Result, error)
- func (db *DB) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (db *DB) Prepare(query string) (*Stmt, error)
- func (db *DB) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (db *DB) Query(query string, args ...any) (*Rows, error)
- func (db *DB) QueryContext(ctx context.Context, query string, args ...any) (*Rows, error)
- func (db *DB) QueryRow(query string, args ...any) *Row
- func (db *DB) QueryRowContext(ctx context.Context, query string, args ...any) *Row
- type Duration
- type Kind
- type NullDuration
- type NullTime
- type Row
- type Rows
- type Stmt
- func (stmt *Stmt) Exec(args ...any) (sql.Result, error)
- func (stmt *Stmt) ExecContext(ctx context.Context, args ...any) (sql.Result, error)
- func (stmt *Stmt) Query(args ...any) (*Rows, error)
- func (stmt *Stmt) QueryContext(ctx context.Context, args ...any) (*Rows, error)
- func (stmt *Stmt) QueryRow(args ...any) *Row
- func (stmt *Stmt) QueryRowContext(ctx context.Context, args ...any) *Row
- type SystemRepo
- type Time
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) Exec(query string, args ...any) (sql.Result, error)
- func (tx *Tx) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (tx *Tx) Prepare(query string) (*Stmt, error)
- func (tx *Tx) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (tx *Tx) Query(query string, args ...any) (*Rows, error)
- func (tx *Tx) QueryContext(ctx context.Context, query string, args ...any) (*Rows, error)
- func (tx *Tx) QueryRow(query string, args ...any) *Row
- func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...any) *Row
- func (tx *Tx) Rollback() error
- func (tx *Tx) Stmt(stmt *Stmt) *Stmt
- func (tx *Tx) StmtContext(ctx context.Context, stmt *Stmt) *Stmt
- type WebRepo
- func (r *WebRepo) AddEmailVerificationToken(ctx context.Context, email string, ttl time.Duration) (string, error)
- func (r *WebRepo) AddResetPasswordToken(ctx context.Context, email string, ttl time.Duration) (string, error)
- func (r *WebRepo) AddResetTOTPToken(ctx context.Context, email string, ttl time.Duration) (string, error)
- func (r *WebRepo) AddSignInMagicLinkToken(ctx context.Context, email string, ttl time.Duration) (string, error)
- func (r *WebRepo) AddTOTPResetVerifyToken(ctx context.Context, email string, ttl time.Duration) (string, error)
- func (r *WebRepo) ConsumeEmailVerificationToken(ctx context.Context, token string) error
- func (r *WebRepo) ConsumeResetPasswordToken(ctx context.Context, token string) error
- func (r *WebRepo) ConsumeResetTOTPToken(ctx context.Context, token string) error
- func (r *WebRepo) ConsumeSignInMagicLinkToken(ctx context.Context, token string) error
- func (r *WebRepo) ConsumeTOTPResetVerifyToken(ctx context.Context, token string) error
- func (r *WebRepo) CountExpiredSessions(ctx context.Context, validWindowStart time.Time) (int, error)
- func (r *WebRepo) CountExpiredTokens(ctx context.Context, now time.Time) (int, error)
- func (r *WebRepo) DeleteExpiredTokens(ctx context.Context, now time.Time) error
- func (r *WebRepo) DestroyExpiredSessions(ctx context.Context, validWindowStart time.Time) error
- func (r *WebRepo) DestroySession(ctx context.Context, id string) error
- func (r *WebRepo) FindEmailVerificationTokenEmail(ctx context.Context, token string) (string, error)
- func (r *WebRepo) FindResetPasswordTokenEmail(ctx context.Context, token string) (string, error)
- func (r *WebRepo) FindResetTOTPTokenEmail(ctx context.Context, token string) (string, error)
- func (r *WebRepo) FindSessionDataByID(ctx context.Context, id string) (session.Data, error)
- func (r *WebRepo) FindSignInMagicLinkTokenEmail(ctx context.Context, token string) (string, error)
- func (r *WebRepo) FindTOTPResetVerifyTokenEmail(ctx context.Context, token string) (string, error)
- func (r *WebRepo) SaveSession(ctx context.Context, sess session.Session) error
Constants ¶
const RFC3339NanoZero = "2006-01-02 15:04:05.000000000Z07:00"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountRepo ¶
type AccountRepo struct {
// contains filtered or unexported fields
}
func NewAccountRepo ¶
func (*AccountRepo) CountStaleSignInAttemptLogs ¶
func (*AccountRepo) CountUsers ¶
func (r *AccountRepo) CountUsers(ctx context.Context) (int, error)
func (*AccountRepo) CountUsersByRoleID ¶
func (*AccountRepo) DeleteStaleSignInAttemptLogs ¶
func (*AccountRepo) FindRecoveryCodesByUserID ¶
func (*AccountRepo) FindRoleByID ¶
func (*AccountRepo) FindRoleByName ¶
func (*AccountRepo) FindRolesByUserID ¶
func (*AccountRepo) FindRolesPageBySearch ¶
func (*AccountRepo) FindSignInAttemptLogByEmail ¶
func (r *AccountRepo) FindSignInAttemptLogByEmail(ctx context.Context, email string) (*account.SignInAttemptLog, error)
func (*AccountRepo) FindUserByEmail ¶
func (*AccountRepo) FindUserByID ¶
func (*AccountRepo) FindUsersPageBySearch ¶
func (*AccountRepo) RemoveRole ¶
func (r *AccountRepo) RemoveRole(ctx context.Context, roleID int) error
func (*AccountRepo) SaveSignInAttemptLog ¶
func (r *AccountRepo) SaveSignInAttemptLog(ctx context.Context, log *account.SignInAttemptLog) error
type Conn ¶
func (*Conn) BeginExclusiveTx ¶
BeginExclusiveTx starts an exclusive transaction with "begin exclusive".
This is a workaround for Go's database/sql package not providing a way to set the transaction type per connection.
References: - https://github.com/golang/go/issues/19981 - https://github.com/mattn/go-sqlite3/issues/400
func (*Conn) BeginImmediateTx ¶
BeginImmediateTx starts an immediate transaction with "begin immediate".
This is a workaround for Go's database/sql package not providing a way to set the transaction type per connection.
References: - https://github.com/golang/go/issues/19981 - https://github.com/mattn/go-sqlite3/issues/400
func (*Conn) ExecContext ¶
func (*Conn) PrepareContext ¶
func (*Conn) QueryContext ¶
type DB ¶
func (*DB) BeginExclusiveTx ¶
BeginExclusiveTx starts an exclusive transaction with "begin exclusive".
This is a workaround for Go's database/sql package not providing a way to set the transaction type per connection.
References: - https://github.com/golang/go/issues/19981 - https://github.com/mattn/go-sqlite3/issues/400
func (*DB) BeginImmediateTx ¶
BeginImmediateTx starts an immediate transaction with "begin immediate".
This is a workaround for Go's database/sql package not providing a way to set the transaction type per connection.
References: - https://github.com/golang/go/issues/19981 - https://github.com/mattn/go-sqlite3/issues/400
func (*DB) ExecContext ¶
func (*DB) PrepareContext ¶
func (*DB) QueryContext ¶
type NullDuration ¶
func (*NullDuration) Scan ¶
func (d *NullDuration) Scan(value any) error
func (NullDuration) String ¶
func (d NullDuration) String() string
type SystemRepo ¶
type SystemRepo struct {
// contains filtered or unexported fields
}
func NewSystemRepo ¶
func NewSystemRepo(ctx context.Context, db *DB) (*SystemRepo, error)
func (*SystemRepo) FindConfig ¶
func (*SystemRepo) SaveConfig ¶
type Tx ¶
func (*Tx) ExecContext ¶
func (*Tx) PrepareContext ¶
func (*Tx) QueryContext ¶
func (*Tx) QueryRowContext ¶
type WebRepo ¶
type WebRepo struct {
// contains filtered or unexported fields
}