model

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedEmail added in v0.1.10

type AllowedEmail struct {
	ID        uuid.UUID `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	Email     string    `db:"email"`
}

func (AllowedEmail) TableName added in v0.1.10

func (AllowedEmail) TableName() string

type AuthProvider

type AuthProvider struct {
	ID uuid.UUID `db:"id"`

	UserID   uuid.UUID `db:"user_id"`
	Provider string    `db:"provider"`

	ProviderUserID *string `db:"provider_user_id"`
	PasswordHash   *string `db:"password_hash"`

	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

func (AuthProvider) TableName

func (AuthProvider) TableName() string

type Challenge added in v0.1.12

type Challenge struct {
	ID        uuid.UUID `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`

	Purpose string `db:"purpose"`
	Email   string `db:"email"`

	ExpiresAt    time.Time  `db:"expires_at"`
	ConsumedAt   *time.Time `db:"consumed_at"`
	AttemptCount int        `db:"attempt_count"`
	MaxAttempts  int        `db:"max_attempts"`

	ResendCount int        `db:"resend_count"`
	MaxResends  int        `db:"max_resends"`
	LastSentAt  *time.Time `db:"last_sent_at"`
}

func (Challenge) TableName added in v0.1.12

func (Challenge) TableName() string

type EmailJob added in v0.1.12

type EmailJob struct {
	ID        uuid.UUID `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`

	ChallengeID  *uuid.UUID `db:"challenge_id"`
	ToEmail      string     `db:"to_email"`
	Template     string     `db:"template"`
	TemplateData []byte     `db:"template_data"`
	Status       string     `db:"status"`

	AttemptCount        int        `db:"attempt_count"`
	NextAttemptAt       time.Time  `db:"next_attempt_at"`
	ProcessingStartedAt *time.Time `db:"processing_started_at"`
	LastError           *string    `db:"last_error"`
	SentAt              *time.Time `db:"sent_at"`
}

func (EmailJob) TableName added in v0.1.12

func (EmailJob) TableName() string

type Passkey added in v0.1.21

type Passkey struct {
	ID        uuid.UUID
	UserID    uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time

	CredentialID      []byte
	PublicKey         []byte
	AttestationType   string
	AttestationFormat string
	Transport         string
	AAGUID            *uuid.UUID
	SignCount         int64
	CloneWarning      bool
	Name              string
	LastUsedAt        *time.Time

	UserPresent    bool
	UserVerified   bool
	BackupEligible bool
	BackupState    bool
}

func (Passkey) TableName added in v0.1.21

func (Passkey) TableName() string

type PendingEmailChange added in v0.1.15

type PendingEmailChange struct {
	ID        uuid.UUID `db:"id"`
	CreatedAt time.Time `db:"created_at"`

	ChallengeID uuid.UUID `db:"challenge_id"`
	UserID      uuid.UUID `db:"user_id"`

	OldEmail string `db:"old_email"`
	NewEmail string `db:"new_email"`
}

func (PendingEmailChange) TableName added in v0.1.15

func (PendingEmailChange) TableName() string

type PendingPasswordReset added in v0.1.14

type PendingPasswordReset struct {
	ID        uuid.UUID `db:"id"`
	CreatedAt time.Time `db:"created_at"`

	ChallengeID  uuid.UUID `db:"challenge_id"`
	UserID       uuid.UUID `db:"user_id"`
	PasswordHash string    `db:"password_hash"`
}

func (PendingPasswordReset) TableName added in v0.1.14

func (PendingPasswordReset) TableName() string
type PendingProviderLink struct {
	ID uuid.UUID `db:"id"`

	UserID      uuid.UUID  `db:"user_id"`
	SessionID   *uuid.UUID `db:"session_id"`
	ChallengeID *uuid.UUID `db:"challenge_id"`
	Provider    string     `db:"provider"`

	ProviderUserID        *string `db:"provider_user_id"`
	ProviderEmail         *string `db:"provider_email"`
	ProviderEmailVerified bool    `db:"provider_email_verified"`
	Purpose               string  `db:"purpose"`

	ExpiresAt  time.Time  `db:"expires_at"`
	ConsumedAt *time.Time `db:"consumed_at"`

	CreatedAt time.Time `db:"created_at"`
}

func (PendingProviderLink) TableName added in v0.1.17

func (PendingProviderLink) TableName() string

type PendingSignupAction added in v0.1.12

type PendingSignupAction struct {
	ID        uuid.UUID `db:"id"`
	CreatedAt time.Time `db:"created_at"`

	ChallengeID  uuid.UUID `db:"challenge_id"`
	Email        string    `db:"email"`
	Username     string    `db:"username"`
	PasswordHash string    `db:"password_hash"`
}

func (PendingSignupAction) TableName added in v0.1.12

func (PendingSignupAction) TableName() string

type RefreshToken

type RefreshToken struct {
	ID        uuid.UUID `db:"id"`
	CreatedAt time.Time `db:"created_at"`

	SessionID uuid.UUID `db:"session_id"`

	TokenHash string `db:"token_hash"`

	ExpiresAt  time.Time  `db:"expires_at"`
	ConsumedAt *time.Time `db:"consumed_at"`
}

func (RefreshToken) TableName

func (RefreshToken) TableName() string

type Role

type Role struct {
	ID        uuid.UUID `db:"id"`
	Name      string    `db:"name"`
	CreatedAt time.Time `db:"created_at"`
}

func (Role) TableName

func (Role) TableName() string

type Session

type Session struct {
	ID        uuid.UUID `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`

	UserID uuid.UUID `db:"user_id"`

	ExpiresAt time.Time  `db:"expires_at"`
	RevokedAt *time.Time `db:"revoked_at"`

	UserAgent string `db:"user_agent"`
}

func (Session) TableName

func (Session) TableName() string

type User

type User struct {
	ID        uuid.UUID `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`

	DisabledAt *time.Time `db:"disabled_at"`

	Username           string `db:"username"`
	UsernameNormalized string `db:"username_normalized"`
	Email              string `db:"email"`
}

func (User) TableName

func (User) TableName() string

type UserRole

type UserRole struct {
	UserID uuid.UUID `db:"user_id"`
	RoleID uuid.UUID `db:"role_id"`

	CreatedAt time.Time `db:"created_at"`
}

func (UserRole) TableName

func (UserRole) TableName() string

type VerificationCode added in v0.1.12

type VerificationCode struct {
	ID        uuid.UUID `db:"id"`
	CreatedAt time.Time `db:"created_at"`

	ChallengeID uuid.UUID `db:"challenge_id"`
	CodeHash    string    `db:"code_hash"`
	ExpiresAt   time.Time `db:"expires_at"`
}

func (VerificationCode) TableName added in v0.1.12

func (VerificationCode) TableName() string

type WebAuthnChallenge added in v0.1.21

type WebAuthnChallenge struct {
	ID        uuid.UUID
	CreatedAt time.Time

	UserID      *uuid.UUID
	Purpose     string
	Challenge   string
	SessionData []byte
	ExpiresAt   time.Time
	ConsumedAt  *time.Time
}

func (WebAuthnChallenge) TableName added in v0.1.21

func (WebAuthnChallenge) TableName() string

Jump to

Keyboard shortcuts

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