model

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 2 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 AuthProvider

type AuthProvider struct {
	ID     *uuid.UUID `gorm:"type:uuid;primaryKey;column:id;default:gen_random_uuid()"`
	UserID string     `gorm:"type:uuid;not null;index;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 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;index;column:session_id"`

	TokenHash string `gorm:"type:varchar(512);not null;uniqueIndex;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;uniqueIndex;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;index;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;uniqueIndex;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"`
}

func (UserRole) TableName

func (UserRole) TableName() string

Jump to

Keyboard shortcuts

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