model

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 AuthenticationChallenge added in v0.22.0

type AuthenticationChallenge struct {
	ID        uuid.UUID `db:"id"`
	UserID    uuid.UUID `db:"user_id"`
	SessionID uuid.UUID `db:"session_id"`

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

	AuthenticationMethod *string `db:"authentication_method"`
}

func (AuthenticationChallenge) TableName added in v0.22.0

func (AuthenticationChallenge) 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"`

	MinimumResendInterval    time.Duration `db:"minimum_resend_interval_ns"`
	HasMinimumResendInterval bool
}

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"`
	DeliveryDeadlineAt  time.Time  `db:"delivery_deadline_at"`
	ProcessingStartedAt *time.Time `db:"processing_started_at"`
	LastError           *string    `db:"last_error"`
	TerminalReason      *string    `db:"terminal_reason"`
	FailedAt            *time.Time `db:"failed_at"`
	SentAt              *time.Time `db:"sent_at"`
}

func (EmailJob) TableName added in v0.1.12

func (EmailJob) TableName() string

type EmailTemplateDeliverySetting added in v0.21.0

type EmailTemplateDeliverySetting struct {
	TemplateKey string `db:"template_key"`
	Enabled     bool   `db:"enabled"`

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

	UpdatedByUserID *uuid.UUID `db:"updated_by_user_id"`
}

func (EmailTemplateDeliverySetting) TableName added in v0.21.0

type EmailTemplateOverride added in v0.20.0

type EmailTemplateOverride struct {
	TemplateKey string `db:"template_key"`

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

	SubjectTemplate string     `db:"subject_template"`
	TextTemplate    string     `db:"text_template"`
	HTMLTemplate    string     `db:"html_template"`
	Revision        int64      `db:"revision"`
	UpdatedByUserID *uuid.UUID `db:"updated_by_user_id"`
}

func (EmailTemplateOverride) TableName added in v0.20.0

func (EmailTemplateOverride) TableName() string

type EmailTemplateVersion added in v0.20.0

type EmailTemplateVersion struct {
	TemplateKey string `db:"template_key"`
	Version     int64  `db:"version"`
	CreatedAt   time.Time

	SubjectTemplate string
	TextTemplate    string
	HTMLTemplate    string
	CreatedByUserID *uuid.UUID
}

func (EmailTemplateVersion) TableName added in v0.20.0

func (EmailTemplateVersion) TableName() string

type EmailVerificationTransaction added in v0.22.0

type EmailVerificationTransaction struct {
	ID                   uuid.UUID  `db:"id"`
	CreatedAt            time.Time  `db:"created_at"`
	UserID               uuid.UUID  `db:"user_id"`
	OriginalSessionID    uuid.UUID  `db:"original_session_id"`
	Audience             string     `db:"audience"`
	AuthenticationMethod string     `db:"authentication_method"`
	ReturnTo             string     `db:"return_to"`
	ExpiresAt            time.Time  `db:"expires_at"`
	ConsumedAt           *time.Time `db:"consumed_at"`
	ChallengeID          *uuid.UUID `db:"challenge_id"`
	TargetEmail          *string    `db:"target_email"`
}

func (EmailVerificationTransaction) TableName added in v0.22.0

type Organization added in v0.1.24

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

	Name            string     `db:"name"`
	Kind            string     `db:"kind"`
	CreatedByUserID *uuid.UUID `db:"created_by_user_id"`
}

func (Organization) TableName added in v0.1.24

func (Organization) TableName() string

type OrganizationInvitation added in v0.1.24

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

	OrganizationID  uuid.UUID       `db:"organization_id"`
	Email           string          `db:"email"`
	Role            string          `db:"role"`
	DeliveryProfile string          `db:"delivery_profile"`
	Metadata        json.RawMessage `db:"metadata"`
	TokenHash       string          `db:"token_hash"`
	InvitedByUserID *uuid.UUID      `db:"invited_by_user_id"`

	ExpiresAt time.Time `db:"expires_at"`

	AcceptedAt       *time.Time `db:"accepted_at"`
	AcceptedByUserID *uuid.UUID `db:"accepted_by_user_id"`
	RevokedAt        *time.Time `db:"revoked_at"`
	RevokedByUserID  *uuid.UUID `db:"revoked_by_user_id"`
}

func (OrganizationInvitation) TableName added in v0.1.24

func (OrganizationInvitation) TableName() string

type OrganizationMembership added in v0.1.24

type OrganizationMembership struct {
	OrganizationID uuid.UUID `db:"organization_id"`
	UserID         uuid.UUID `db:"user_id"`

	Role string `db:"role"`

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

func (OrganizationMembership) TableName added in v0.1.24

func (OrganizationMembership) 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
	RestrictedAt      *time.Time
	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"`
	InitiatingSessionID uuid.UUID `db:"initiating_session_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"`
	InvitationID *uuid.UUID `db:"invitation_id"`
}

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"`
	OrganizationID uuid.UUID `db:"organization_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"`
	ActiveOrganizationID uuid.UUID `db:"active_organization_id"`

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

	AuthenticatedAt      *time.Time `db:"authenticated_at"`
	AuthenticationMethod *string    `db:"authentication_method"`

	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"`
	EmailVerifiedAt    *time.Time `db:"email_verified_at"`
}

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
	SessionID   *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

type WebhookEvent added in v0.1.27

type WebhookEvent struct {
	ID        string    `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`

	EventType string `db:"event_type"`
	Payload   []byte `db:"payload"`
	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"`
	DeliveredAt         *time.Time `db:"delivered_at"`
}

func (WebhookEvent) TableName added in v0.1.27

func (WebhookEvent) TableName() string

Jump to

Keyboard shortcuts

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