database

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	gorm.Model
	StoredFileId   uint
	Addr           string
	UserAgent      string
	TLSVersion     string
	TLSCipherSuite string
	Location       *geoip.Location `gorm:"-"`
}

type Database

type Database struct {
	*gorm.DB
}

func New

func New(config *config.Config) (*Database, error)

func (*Database) IsRecordNotFoundError

func (*Database) IsRecordNotFoundError(err error) bool

type DstClient

type DstClient Client

type Stats

type Stats struct {
	URL     string `form:"url" gorm:"not null" binding:"required,url,max=255"`
	*Client `form:"-"`
}

type StoredFile

type StoredFile struct {
	gorm.Model
	Type         string                `form:"type"                                     binding:"omitempty,printascii,min=1,max=255"`
	FileId       string                `form:"-"              gorm:"not null"`
	OwnerToken   string                `form:"-"`
	File         *multipart.FileHeader `form:"file"           gorm:"-"                  binding:"required"`
	Filename     string                `form:"filename"       gorm:"type:varchar(1024)" binding:"omitempty,max=1024"`
	Name         string                `form:"-"              gorm:"not null"`
	Email        string                `form:"email"                                    binding:"omitempty,email,min=4,max=255"`
	Expiry       uint                  `form:"expiry"         gorm:"default:14"         binding:"omitempty,min=1,max=14"`
	Count        uint                  `form:"count"          gorm:"default:1"          binding:"omitempty,min=1,max=15"`
	OnlyEEA      bool                  `form:"only-eea"`
	IncludeOther bool                  `form:"include-other"`
	SrcClient    *Client               `form:"-"`
	DstClients   []*DstClient          `form:"-"`
}

Jump to

Keyboard shortcuts

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