sqlcpostgres

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetCredentialRow

type GetCredentialRow struct {
	TotpSecret  string `json:"totp_secret"`
	TotpEnabled int32  `json:"totp_enabled"`
}

type IsSessionVerifiedParams

type IsSessionVerifiedParams struct {
	SessionID  string    `json:"session_id"`
	UserID     string    `json:"user_id"`
	VerifiedAt time.Time `json:"verified_at"`
}

type MarkSessionVerifiedParams

type MarkSessionVerifiedParams struct {
	SessionID  string    `json:"session_id"`
	UserID     string    `json:"user_id"`
	VerifiedAt time.Time `json:"verified_at"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DeleteSessionVerification

func (q *Queries) DeleteSessionVerification(ctx context.Context, sessionID string) error

func (*Queries) DeleteUserSessionVerifications

func (q *Queries) DeleteUserSessionVerifications(ctx context.Context, userID string) error

func (*Queries) GetCredential

func (q *Queries) GetCredential(ctx context.Context, id string) (GetCredentialRow, error)

TOTP credential and session queries

func (*Queries) IsSessionVerified

func (q *Queries) IsSessionVerified(ctx context.Context, arg IsSessionVerifiedParams) (bool, error)

func (*Queries) MarkSessionVerified

func (q *Queries) MarkSessionVerified(ctx context.Context, arg MarkSessionVerifiedParams) error

func (*Queries) UpdateCredential

func (q *Queries) UpdateCredential(ctx context.Context, arg UpdateCredentialParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Session

type Session struct {
	ID           string         `json:"id"`
	UserID       string         `json:"user_id"`
	Token        string         `json:"token"`
	RefreshToken sql.NullString `json:"refresh_token"`
	ExpiresAt    time.Time      `json:"expires_at"`
	CreatedAt    time.Time      `json:"created_at"`
	IpAddress    sql.NullString `json:"ip_address"`
	UserAgent    sql.NullString `json:"user_agent"`
}

type TotpSession

type TotpSession struct {
	SessionID  string    `json:"session_id"`
	UserID     string    `json:"user_id"`
	VerifiedAt time.Time `json:"verified_at"`
}

type UpdateCredentialParams

type UpdateCredentialParams struct {
	ID          string         `json:"id"`
	TotpSecret  sql.NullString `json:"totp_secret"`
	TotpEnabled int32          `json:"totp_enabled"`
	UpdatedAt   time.Time      `json:"updated_at"`
}

type User

type User struct {
	ID          string         `json:"id"`
	Avatar      sql.NullString `json:"avatar"`
	Name        string         `json:"name"`
	Email       sql.NullString `json:"email"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
	Disabled    int32          `json:"disabled"`
	TotpSecret  sql.NullString `json:"totp_secret"`
	TotpEnabled int32          `json:"totp_enabled"`
}

Jump to

Keyboard shortcuts

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