model

package
v0.1.0-develop.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 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 Account

type Account struct {
	gorm.Model
	ID          uint   `gorm:"primaryKey" gorm:"AUTO_INCREMENT"`
	Email       string `gorm:"uniqueIndex"`
	Password    *string
	CreatedAt   time.Time
	UpdatedAt   time.Time
	LoginTokens []LoginSession
	Keys        []Key
}
type Dnslink struct {
	gorm.Model
	ID     uint   `gorm:"primaryKey" gorm:"AUTO_INCREMENT"`
	Domain string `gorm:"uniqueIndex"`
}

type Key

type Key struct {
	gorm.Model
	ID        uint `gorm:"primaryKey" gorm:"AUTO_INCREMENT"`
	AccountID uint
	Account   Account
	Pubkey    string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type KeyChallenge

type KeyChallenge struct {
	gorm.Model
	ID         uint `gorm:"primaryKey" gorm:"AUTO_INCREMENT"`
	AccountID  uint
	Account    Account
	Challenge  string `gorm:"not null"`
	Expiration time.Time
}

type LoginSession

type LoginSession struct {
	gorm.Model
	ID         uint `gorm:"primaryKey" gorm:"AUTO_INCREMENT"`
	AccountID  uint
	Account    Account
	Token      string `gorm:"uniqueIndex"`
	Expiration time.Time
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

func (*LoginSession) BeforeCreate

func (s *LoginSession) BeforeCreate(tx *gorm.DB) (err error)

type Pin

type Pin struct {
	gorm.Model
	ID        uint `gorm:"primaryKey" gorm:"AUTO_INCREMENT"`
	AccountID uint `gorm:"uniqueIndex:idx_account_upload"`
	UploadID  uint `gorm:"uniqueIndex:idx_account_upload"`
	Account   Account
	Upload    Upload
}

type Tus

type Tus struct {
	gorm.Model
	ID        uint `gorm:"primaryKey" gorm:"AUTO_INCREMENT"`
	UploadID  string
	Hash      string
	Info      string
	AccountID uint
	Account   Account
}

type Upload

type Upload struct {
	gorm.Model
	ID        uint `gorm:"primaryKey" gorm:"AUTO_INCREMENT"`
	AccountID uint `gorm:"index"`
	Account   Account
	Hash      string `gorm:"uniqueIndex"`
}

Jump to

Keyboard shortcuts

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