models

package
v0.0.0-...-ee7fb9c Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientSession

type ClientSession struct {
	UserSlug  string    `gorm:"not null"`
	User      User      `gorm:"foreignKey:UserSlug;constraint:OnDelete:CASCADE"`
	ClientIP  string    `gorm:"not null"`
	Digest    []byte    `gorm:"unique;not null"`
	TokenKey  string    `gorm:"primaryKey;size:16;not null"`
	CreatedAt time.Time `gorm:"autoCreateTime:false;not null"`
	ExpiresAt time.Time `gorm:"not null"`
}

func (ClientSession) TableName

func (ClientSession) TableName() string

type EmailVerificationToken

type EmailVerificationToken struct {
	UserSlug  string    `gorm:"not null"`
	User      User      `gorm:"foreignKey:UserSlug;constraint:OnDelete:CASCADE"`
	KeyDigest []byte    `gorm:"unique;not null"`
	OTPDigest []byte    `gorm:"unique;not null"`
	TokenKey  string    `gorm:"primaryKey;size:16;not null"`
	CreatedAt time.Time `gorm:"autoCreateTime:false;not null"`
	ExpiresAt time.Time `gorm:"not null"`
}

type Log

type Log struct {
	ID              uint      `json:"id" gorm:"primaryKey;autoIncrement"`
	Caller          string    `json:"caller"`
	ClientIP        string    `json:"client_ip"`
	ClientOperation string    `json:"client_operation"`
	ContextString   string    `json:"context_string"`
	CreatedAt       time.Time `json:"created_at" gorm:"autoCreateTime:nano;not null"`
	Detail          string    `json:"detail"`
	Extra           string    `json:"extra"`
	Level           string    `json:"level"`
	Message         string    `json:"message"`
	RequestBody     string    `json:"request_body"`
	UserSlug        string    `json:"user_slug"`
}

type MFAToken

type MFAToken struct {
	UserSlug  string    `gorm:"not null"`
	User      User      `gorm:"foreignKey:UserSlug;constraint:OnDelete:CASCADE"`
	KeyDigest []byte    `gorm:"unique;not null"`
	OTPDigest []byte    `gorm:"unique;not null"`
	TokenKey  string    `gorm:"primaryKey;size:16;not null"`
	CreatedAt time.Time `gorm:"autoCreateTime:false;not null"`
	ExpiresAt time.Time `gorm:"not null"`
}

func (MFAToken) TableName

func (MFAToken) TableName() string

type PhoneVerificationToken

type PhoneVerificationToken struct {
	UserSlug  string    `gorm:"not null"`
	User      User      `gorm:"foreignKey:UserSlug;constraint:OnDelete:CASCADE"`
	KeyDigest []byte    `gorm:"unique;not null"`
	OTPDigest []byte    `gorm:"unique;not null"`
	TokenKey  string    `gorm:"primaryKey;size:16;not null"`
	CreatedAt time.Time `gorm:"autoCreateTime:false;not null"`
	ExpiresAt time.Time `gorm:"not null"`
}

type User

type User struct {
	Slug            string    `json:"user_slug" gorm:"primaryKey;not null"`
	PasswordHash    []byte    `json:"-" gorm:"not null"`
	PasswordSalt    []byte    `json:"-" gorm:"not null"`
	Name            string    `json:"name" gorm:"not null"`
	EmailAddress    string    `json:"email_address,omitempty" gorm:"unique;not null"`
	PhoneNumber     string    `json:"phone_number,omitempty" gorm:"unique;not null"`
	IsActive        bool      `json:"-" gorm:"default:true;not null"`
	EmailIsVerified bool      `json:"email_is_verified" gorm:"default:false;not null"`
	PhoneIsVerified bool      `json:"phone_is_verified" gorm:"default:false;not null"`
	CreatedAt       time.Time `json:"-" gorm:"autoCreateTime:nano;not null"`
	UpdatedAt       time.Time `json:"-" gorm:"autoUpdateTime:nano;not null"`
}

Jump to

Keyboard shortcuts

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