model

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: May 7, 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 `gorm:"type:uuid;primaryKey;colum:id;default:gen_random_uuid()"`
	CreatedAt time.Time  `gorm:"not null;column:created_at"`
	UpdatedAt time.Time  `gorm:"not null;column:updated_at"`
	Email     string     `gorm:"type:varchar();not null;column:email"`
}

func (AllowedEmail) TableName added in v0.1.10

func (AllowedEmail) TableName() string

type AuthProvider

type AuthProvider struct {
	ID *uuid.UUID `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`

	UserID   uuid.UUID `gorm:"type:uuid;not null;column:user_id"`
	Provider string    `gorm:"type:varchar(50);not null;column:provider"`

	ProviderUserID *string `gorm:"type:varchar(255);column:provider_user_id"`
	PasswordHash   *string `gorm:"type:varchar(255);column:password_hash"`

	CreatedAt time.Time `gorm:"not null;column:created_at"`
	UpdatedAt time.Time `gorm:"not null;column:updated_at"`
}

func (AuthProvider) TableName

func (AuthProvider) TableName() string

type Challenge added in v0.1.12

type Challenge struct {
	ID        *uuid.UUID `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`
	CreatedAt time.Time  `gorm:"not null;column:created_at"`
	UpdatedAt time.Time  `gorm:"not null;column:updated_at"`

	Purpose string `gorm:"type:varchar(64);not null;column:purpose"`
	Email   string `gorm:"type:varchar(255);not null;column:email"`

	ExpiresAt    time.Time  `gorm:"not null;column:expires_at"`
	ConsumedAt   *time.Time `gorm:"column:consumed_at"`
	AttemptCount int        `gorm:"not null;column:attempt_count"`
	MaxAttempts  int        `gorm:"not null;column:max_attempts"`

	ResendCount int        `gorm:"not null;column:resend_count"`
	MaxResends  int        `gorm:"not null;column:max_resends"`
	LastSentAt  *time.Time `gorm:"column: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 `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`
	CreatedAt time.Time  `gorm:"not null;column:created_at"`
	UpdatedAt time.Time  `gorm:"not null;column:updated_at"`

	ChallengeID  *uuid.UUID `gorm:"type:uuid;column:challenge_id"`
	ToEmail      string     `gorm:"type:varchar(255);not null;column:to_email"`
	Template     string     `gorm:"type:varchar(64);not null;column:template"`
	TemplateData []byte     `gorm:"type:jsonb;column:template_data"`
	Status       string     `gorm:"type:varchar(32);not null;index;column:status"`

	AttemptCount        int        `gorm:"not null;column:attempt_count"`
	NextAttemptAt       time.Time  `gorm:"not null;column:next_attempt_at"`
	ProcessingStartedAt *time.Time `gorm:"column:processing_started_at"`
	LastError           *string    `gorm:"type:text;column:last_error"`
	SentAt              *time.Time `gorm:"column:sent_at"`
}

func (EmailJob) TableName added in v0.1.12

func (EmailJob) TableName() string

type PendingEmailChange added in v0.1.15

type PendingEmailChange struct {
	ID        *uuid.UUID `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`
	CreatedAt time.Time  `gorm:"not null;column:created_at"`

	ChallengeID uuid.UUID `gorm:"type:uuid;not null;column:challenge_id"`
	UserID      uuid.UUID `gorm:"type:uuid;not null;column:user_id"`

	OldEmail string `gorm:"type:varchar(255);not null;column:old_email"`
	NewEmail string `gorm:"type:varchar(255);not null;column: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 `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`
	CreatedAt time.Time  `gorm:"not null;column:created_at"`

	ChallengeID  uuid.UUID `gorm:"type:uuid;not null;column:challenge_id"`
	UserID       uuid.UUID `gorm:"type:uuid;not null;column:user_id"`
	PasswordHash string    `gorm:"type:varchar(255);not null;column:password_hash"`
}

func (PendingPasswordReset) TableName added in v0.1.14

func (PendingPasswordReset) TableName() string
type PendingProviderLink struct {
	ID *uuid.UUID `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`

	UserID      uuid.UUID  `gorm:"type:uuid;not null;column:user_id"`
	SessionID   *uuid.UUID `gorm:"type:uuid;column:session_id"`
	ChallengeID *uuid.UUID `gorm:"type:uuid;column:challenge_id"`
	Provider    string     `gorm:"type:varchar(50);not null;column:provider"`

	ProviderUserID        *string `gorm:"type:varchar(255);column:provider_user_id"`
	ProviderEmail         *string `gorm:"type:varchar(255);column:provider_email"`
	ProviderEmailVerified bool    `gorm:"not null;column:provider_email_verified"`
	Purpose               string  `gorm:"type:varchar(64);not null;column:purpose"`

	ExpiresAt  time.Time  `gorm:"not null;column:expires_at"`
	ConsumedAt *time.Time `gorm:"column:consumed_at"`

	CreatedAt time.Time `gorm:"not null;column: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 `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`
	CreatedAt time.Time  `gorm:"not null;column:created_at"`

	ChallengeID  uuid.UUID `gorm:"type:uuid;not null;column:challenge_id"`
	Email        string    `gorm:"type:varchar(255);not null;column:email"`
	Username     string    `gorm:"type:varchar(255);not null;column:username"`
	PasswordHash string    `gorm:"type:varchar(255);not null;column:password_hash"`
}

func (PendingSignupAction) TableName added in v0.1.12

func (PendingSignupAction) TableName() string

type RefreshToken

type RefreshToken struct {
	ID        *uuid.UUID `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`
	CreatedAt time.Time  `gorm:"not null;column:created_at"`

	SessionID uuid.UUID `gorm:"type:uuid;not null;column:session_id"`

	TokenHash string `gorm:"type:varchar(512);not null;column:token_hash"`

	ExpiresAt  time.Time  `gorm:"not null;column:expires_at"`
	ConsumedAt *time.Time `gorm:"column:consumed_at"`
}

func (RefreshToken) TableName

func (RefreshToken) TableName() string

type Role

type Role struct {
	ID        *uuid.UUID `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`
	Name      string     `gorm:"type:text;not null;column:name"`
	CreatedAt time.Time  `gorm:"not null;column:created_at"`
}

func (Role) TableName

func (Role) TableName() string

type Session

type Session struct {
	ID        *uuid.UUID `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`
	CreatedAt time.Time  `gorm:"not null;column:created_at"`
	UpdatedAt time.Time  `gorm:"not null;column:updated_at"`

	UserID uuid.UUID `gorm:"type:uuid;not null;column:user_id"`

	ExpiresAt time.Time  `gorm:"not null;column:expires_at"`
	RevokedAt *time.Time `gorm:"column:revoked_at"`

	UserAgent string `gorm:"type:varchar(255);not null;column:user_agent"`
}

func (Session) TableName

func (Session) TableName() string

type User

type User struct {
	ID        *uuid.UUID `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`
	CreatedAt time.Time  `gorm:"not null;column:created_at"`
	UpdatedAt time.Time  `gorm:"not null;column:updated_at"`

	DisabledAt *time.Time `gorm:"column:disabled_at"`

	Username           string `gorm:"type:varchar(255);not null;column:username"`
	UsernameNormalized string `gorm:"type:varchar(255);not null;column:username_normalized"`
	Email              string `gorm:"type:varchar(255);not null;column:email"`
}

func (User) TableName

func (User) TableName() string

type UserRole

type UserRole struct {
	UserID uuid.UUID `gorm:"type:uuid;not null;column:user_id;primaryKey"`
	RoleID uuid.UUID `gorm:"type:uuid;not null;column:role_id;primaryKey"`

	CreatedAt time.Time `gorm:"not null;column:created_at"`
}

func (UserRole) TableName

func (UserRole) TableName() string

type VerificationCode added in v0.1.12

type VerificationCode struct {
	ID        *uuid.UUID `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`
	CreatedAt time.Time  `gorm:"not null;column:created_at"`

	ChallengeID uuid.UUID `gorm:"type:uuid;not null;column:challenge_id"`
	CodeHash    string    `gorm:"type:varchar(255);not null;column:code_hash"`
	ExpiresAt   time.Time `gorm:"not null;column:expires_at"`
}

func (VerificationCode) TableName added in v0.1.12

func (VerificationCode) TableName() string

Jump to

Keyboard shortcuts

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