model

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	BaseModel
	Name               string      `json:"name" gorm:"type:varchar(64);not null"`
	Key                string      `json:"key" gorm:"type:varchar(64);not null;uniqueIndex"`
	ShortDescZh        string      `json:"shortDescZh" gorm:"type:longtext;"`
	ShortDescEn        string      `json:"shortDescEn" gorm:"type:longtext;"`
	Icon               string      `json:"icon" gorm:"type:longtext;"`
	Type               string      `json:"type" gorm:"type:varchar(64);not null"`
	Status             string      `json:"status" gorm:"type:varchar(64);not null"`
	Required           string      `json:"required" gorm:"type:varchar(64);not null"`
	CrossVersionUpdate bool        `json:"crossVersionUpdate"`
	Limit              int         `json:"limit" gorm:"type:Integer;not null"`
	Website            string      `json:"website" gorm:"type:varchar(64);not null"`
	Github             string      `json:"github" gorm:"type:varchar(64);not null"`
	Document           string      `json:"document" gorm:"type:varchar(64);not null"`
	Recommend          int         `json:"recommend" gorm:"type:Integer;not null"`
	Details            []AppDetail `json:"-" gorm:"-:migration"`
	TagsKey            []string    `json:"-" gorm:"-"`
	AppTags            []AppTag    `json:"-" gorm:"-:migration"`
}

type AppDetail

type AppDetail struct {
	BaseModel
	AppId         uint   `json:"appId" gorm:"type:integer;not null"`
	Version       string `json:"version" gorm:"type:varchar(64);not null"`
	Params        string `json:"-" gorm:"type:longtext;"`
	DockerCompose string `json:"-"  gorm:"type:longtext;not null"`
	Readme        string `json:"readme"  gorm:"type:longtext;"`
	Status        string `json:"status" gorm:"type:varchar(64);not null"`
	LastVersion   string `json:"lastVersion" gorm:"type:varchar(64);"`
}

type AppInstall

type AppInstall struct {
	BaseModel
	Name          string `json:"name" gorm:"type:varchar(64);not null;UNIQUE"`
	AppId         uint   `json:"appId" gorm:"type:integer;not null"`
	AppDetailId   uint   `json:"appDetailId" gorm:"type:integer;not null"`
	Version       string `json:"version" gorm:"type:varchar(64);not null"`
	Param         string `json:"param"  gorm:"type:longtext;"`
	Env           string `json:"env"  gorm:"type:longtext;"`
	DockerCompose string `json:"dockerCompose"  gorm:"type:longtext;"`
	Status        string `json:"status" gorm:"type:varchar(256);not null"`
	Description   string `json:"description" gorm:"type:varchar(256);"`
	Message       string `json:"message"  gorm:"type:longtext;"`
	ContainerName string `json:"containerName" gorm:"type:varchar(256);not null"`
	ServiceName   string `json:"serviceName" gorm:"type:varchar(256);not null"`
	HttpPort      int    `json:"httpPort" gorm:"type:integer;not null"`
	HttpsPort     int    `json:"httpsPort" gorm:"type:integer;not null"`
	App           App    `json:"app" gorm:"-:migration"`
}

func (*AppInstall) GetComposePath

func (i *AppInstall) GetComposePath() string

func (*AppInstall) GetPath

func (i *AppInstall) GetPath() string

type AppInstallResource

type AppInstallResource struct {
	BaseModel
	AppInstallId uint   `json:"appInstallId" gorm:"type:integer;not null;"`
	LinkId       uint   `json:"linkId"  gorm:"type:integer;not null;"`
	ResourceId   uint   `json:"resourceId" gorm:"type:integer;"`
	Key          string `json:"key" gorm:"type:varchar(64);not null"`
}

type AppTag

type AppTag struct {
	BaseModel
	AppId uint `json:"appId" gorm:"type:integer;not null"`
	TagId uint `json:"tagId" gorm:"type:integer;not null"`
}

type BackupAccount

type BackupAccount struct {
	BaseModel
	Type       string `gorm:"type:varchar(64);unique;not null" json:"type"`
	Bucket     string `gorm:"type:varchar(256)" json:"bucket"`
	AccessKey  string `gorm:"type:varchar(256)" json:"accessKey"`
	Credential string `gorm:"type:varchar(256)" json:"credential"`
	Vars       string `gorm:"type:longText" json:"vars"`
}

type BackupRecord

type BackupRecord struct {
	BaseModel
	Type       string `gorm:"type:varchar(64);not null" json:"type"`
	Name       string `gorm:"type:varchar(64);not null" json:"name"`
	DetailName string `gorm:"type:varchar(256)" json:"detailName"`
	Source     string `gorm:"type:varchar(256)" json:"source"`
	BackupType string `gorm:"type:varchar(256)" json:"backupType"`
	FileDir    string `gorm:"type:varchar(256)" json:"fileDir"`
	FileName   string `gorm:"type:varchar(256)" json:"fileName"`
}

type BaseModel

type BaseModel struct {
	ID        uint      `gorm:"primarykey;AUTO_INCREMENT" json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type Command

type Command struct {
	BaseModel
	Name    string `gorm:"type:varchar(64);unique;not null" json:"name"`
	Command string `gorm:"type:varchar(256);not null" json:"command"`
}

type Compose

type Compose struct {
	BaseModel

	Name string `gorm:"type:varchar(256)" json:"name"`
}

type ComposeTemplate

type ComposeTemplate struct {
	BaseModel

	Name        string `gorm:"type:varchar(64);not null;unique" json:"name"`
	Description string `gorm:"type:varchar(256)" json:"description"`
	Content     string `gorm:"type:longtext" json:"content"`
}

type Cronjob

type Cronjob struct {
	BaseModel

	Name     string `gorm:"type:varchar(64);not null;unique" json:"name"`
	Type     string `gorm:"type:varchar(64);not null" json:"type"`
	SpecType string `gorm:"type:varchar(64);not null" json:"specType"`
	Spec     string `gorm:"type:varchar(64);not null" json:"spec"`
	Week     uint64 `gorm:"type:decimal" json:"week"`
	Day      uint64 `gorm:"type:decimal" json:"day"`
	Hour     uint64 `gorm:"type:decimal" json:"hour"`
	Minute   uint64 `gorm:"type:decimal" json:"minute"`

	Script         string `gorm:"longtext" json:"script"`
	Website        string `gorm:"type:varchar(64)" json:"website"`
	DBName         string `gorm:"type:varchar(64)" json:"dbName"`
	URL            string `gorm:"type:varchar(256)" json:"url"`
	SourceDir      string `gorm:"type:varchar(256)" json:"sourceDir"`
	ExclusionRules string `gorm:"longtext" json:"exclusionRules"`

	KeepLocal    bool   `gorm:"type:varchar(64)" json:"keepLocal"`
	TargetDirID  uint64 `gorm:"type:decimal" json:"targetDirID"`
	RetainCopies uint64 `gorm:"type:decimal" json:"retainCopies"`

	Status  string       `gorm:"type:varchar(64)" json:"status"`
	EntryID uint64       `gorm:"type:decimal" json:"entryID"`
	Records []JobRecords `json:"records"`
}

type DatabaseMysql

type DatabaseMysql struct {
	BaseModel
	Name        string `json:"name" gorm:"type:varchar(256);not null"`
	MysqlName   string `json:"mysqlName" gorm:"type:varchar(64);not null"`
	Format      string `json:"format" gorm:"type:varchar(64);not null"`
	Username    string `json:"username" gorm:"type:varchar(256);not null"`
	Password    string `json:"password" gorm:"type:varchar(256);not null"`
	Permission  string `json:"permission" gorm:"type:varchar(256);not null"`
	Description string `json:"description" gorm:"type:varchar(256);"`
}

type Group

type Group struct {
	BaseModel
	IsDefault bool   `json:"isDefault"`
	Name      string `gorm:"type:varchar(64);not null" json:"name"`
	Type      string `gorm:"type:varchar(16);not null" json:"type"`
}

type Host

type Host struct {
	BaseModel
	GroupID    uint   `gorm:"type:decimal;not null" json:"group_id"`
	Name       string `gorm:"type:varchar(64);not null" json:"name"`
	Addr       string `gorm:"type:varchar(16);not null" json:"addr"`
	Port       int    `gorm:"type:decimal;not null" json:"port"`
	User       string `gorm:"type:varchar(64);not null" json:"user"`
	AuthMode   string `gorm:"type:varchar(16);not null" json:"authMode"`
	Password   string `gorm:"type:varchar(64)" json:"password"`
	PrivateKey string `gorm:"type:varchar(256)" json:"privateKey"`

	Description string `gorm:"type:varchar(256)" json:"description"`
}

type ImageRepo

type ImageRepo struct {
	BaseModel

	Name        string `gorm:"type:varchar(64);not null" json:"name"`
	DownloadUrl string `gorm:"type:varchar(256)" json:"downloadUrl"`
	Protocol    string `gorm:"type:varchar(64)" json:"protocol"`
	Username    string `gorm:"type:varchar(256)" json:"username"`
	Password    string `gorm:"type:varchar(256)" json:"password"`
	Auth        bool   `gorm:"type:varchar(256)" json:"auth"`

	Status  string `gorm:"type:varchar(64)" json:"status"`
	Message string `gorm:"type:varchar(256)" json:"message"`
}

type JobRecords

type JobRecords struct {
	BaseModel

	CronjobID uint      `gorm:"type:decimal" json:"cronjobID"`
	StartTime time.Time `gorm:"type:datetime" json:"startTime"`
	Interval  float64   `gorm:"type:float" json:"interval"`
	Records   string    `gorm:"longtext" json:"records"`
	FromLocal bool      `gorm:"type:varchar(64)" json:"source"`
	File      string    `gorm:"type:varchar(256)" json:"file"`
	Status    string    `gorm:"type:varchar(64)" json:"status"`
	Message   string    `gorm:"longtext" json:"message"`
}

type LoginLog

type LoginLog struct {
	BaseModel
	IP      string `gorm:"type:varchar(64)" json:"ip"`
	Address string `gorm:"type:varchar(64)" json:"address"`
	Agent   string `gorm:"type:varchar(256)" json:"agent"`
	Status  string `gorm:"type:varchar(64)" json:"status"`
	Message string `gorm:"type:longText" json:"message"`
}

type MonitorBase

type MonitorBase struct {
	BaseModel
	Cpu float64 `gorm:"type:float" json:"cpu"`

	LoadUsage float64 `gorm:"type:float" json:"loadUsage"`
	CpuLoad1  float64 `gorm:"type:float" json:"cpuLoad1"`
	CpuLoad5  float64 `gorm:"type:float" json:"cpuLoad5"`
	CpuLoad15 float64 `gorm:"type:float" json:"cpuLoad15"`

	Memory float64 `gorm:"type:float" json:"memory"`
}

type MonitorIO

type MonitorIO struct {
	BaseModel
	Name  string `json:"name"`
	Read  uint64 `json:"read"`
	Write uint64 `json:"write"`
	Count uint64 `json:"count"`
	Time  uint64 `json:"time"`
}

type MonitorNetwork

type MonitorNetwork struct {
	BaseModel
	Name string  `json:"name"`
	Up   float64 `gorm:"type:float" json:"up"`
	Down float64 `gorm:"type:float" json:"down"`
}

type OperationLog

type OperationLog struct {
	BaseModel
	Source string `gorm:"type:varchar(64)" json:"source"`

	IP        string `gorm:"type:varchar(64)" json:"ip"`
	Path      string `gorm:"type:varchar(64)" json:"path"`
	Method    string `gorm:"type:varchar(64)" json:"method"`
	UserAgent string `gorm:"type:varchar(256)" json:"userAgent"`

	Latency time.Duration `gorm:"type:varchar(64)" json:"latency"`
	Status  string        `gorm:"type:varchar(64)" json:"status"`
	Message string        `gorm:"type:varchar(256)" json:"message"`

	DetailZH string `gorm:"type:varchar(256)" json:"detailZH"`
	DetailEN string `gorm:"type:varchar(256)" json:"detailEN"`
}

type Setting

type Setting struct {
	BaseModel
	Key   string `json:"key" gorm:"type:varchar(256);not null;"`
	Value string `json:"value" gorm:"type:varchar(256)"`
	About string `json:"about" gorm:"type:longText"`
}

type Snapshot

type Snapshot struct {
	BaseModel
	Name        string `json:"name" gorm:"type:varchar(64);not null;unique"`
	Description string `json:"description" gorm:"type:varchar(256)"`
	From        string `json:"from"`
	Status      string `json:"status" gorm:"type:varchar(64)"`
	Message     string `json:"message" gorm:"type:varchar(256)"`
	Version     string `json:"version" gorm:"type:varchar(256)"`

	InterruptStep    string `json:"interruptStep" gorm:"type:varchar(64)"`
	RecoverStatus    string `json:"recoverStatus" gorm:"type:varchar(64)"`
	RecoverMessage   string `json:"recoverMessage" gorm:"type:varchar(256)"`
	LastRecoveredAt  string `json:"lastRecoveredAt" gorm:"type:varchar(64)"`
	RollbackStatus   string `json:"rollbackStatus" gorm:"type:varchar(64)"`
	RollbackMessage  string `json:"rollbackMessage" gorm:"type:varchar(256)"`
	LastRollbackedAt string `json:"lastRollbackedAt" gorm:"type:varchar(64)"`
}

type Tag

type Tag struct {
	BaseModel
	Key  string `json:"key" gorm:"type:varchar(64);not null"`
	Name string `json:"name" gorm:"type:varchar(64);not null"`
}

type Website

type Website struct {
	BaseModel
	Protocol       string          `gorm:"type:varchar(64);not null" json:"protocol"`
	PrimaryDomain  string          `gorm:"type:varchar(128);not null" json:"primaryDomain"`
	Type           string          `gorm:"type:varchar(64);not null" json:"type"`
	Alias          string          `gorm:"type:varchar(128);not null" json:"alias"`
	Remark         string          `gorm:"type:longtext;" json:"remark"`
	Status         string          `gorm:"type:varchar(64);not null" json:"status"`
	HttpConfig     string          `gorm:"type:varchar(64);not null" json:"httpConfig"`
	ExpireDate     time.Time       `json:"expireDate"`
	AppInstallID   uint            `gorm:"type:integer" json:"appInstallId"`
	WebsiteGroupID uint            `gorm:"type:integer" json:"webSiteGroupId"`
	WebsiteSSLID   uint            `gorm:"type:integer" json:"webSiteSSLId"`
	Proxy          string          `gorm:"type:varchar(128);not null" json:"proxy"`
	ErrorLog       bool            `json:"errorLog"`
	AccessLog      bool            `json:"accessLog"`
	DefaultServer  bool            `json:"defaultServer"`
	Domains        []WebsiteDomain `json:"domains" gorm:"-:migration"`
	WebsiteSSL     WebsiteSSL      `json:"webSiteSSL" gorm:"-:migration"`
}

func (Website) TableName

func (w Website) TableName() string

type WebsiteAcmeAccount

type WebsiteAcmeAccount struct {
	BaseModel
	Email      string `gorm:"type:varchar(256);not null" json:"email"`
	URL        string `gorm:"type:varchar(256);not null" json:"url"`
	PrivateKey string `gorm:"type:longtext;not null" json:"-"`
}

func (WebsiteAcmeAccount) TableName

func (w WebsiteAcmeAccount) TableName() string

type WebsiteDnsAccount

type WebsiteDnsAccount struct {
	BaseModel
	Name          string `gorm:"type:varchar(64);not null" json:"name"`
	Type          string `gorm:"type:varchar(64);not null" json:"type"`
	Authorization string `gorm:"type:varchar(256);not null" json:"-"`
}

func (WebsiteDnsAccount) TableName

func (w WebsiteDnsAccount) TableName() string

type WebsiteDomain

type WebsiteDomain struct {
	BaseModel
	WebsiteID uint   `gorm:"column:website_id;type:varchar(64);not null;" json:"websiteId"`
	Domain    string `gorm:"type:varchar(256);not null" json:"domain"`
	Port      int    `gorm:"type:integer" json:"port"`
}

func (WebsiteDomain) TableName

func (w WebsiteDomain) TableName() string

type WebsiteGroup

type WebsiteGroup struct {
	BaseModel
	Name    string `gorm:"type:varchar(64);not null" json:"name"`
	Default bool   `json:"default"`
}

func (WebsiteGroup) TableName

func (w WebsiteGroup) TableName() string

type WebsiteSSL

type WebsiteSSL struct {
	BaseModel
	PrimaryDomain string    `gorm:"type:varchar(256);not null" json:"primaryDomain"`
	PrivateKey    string    `gorm:"type:longtext;not null" json:"privateKey"`
	Pem           string    `gorm:"type:longtext;not null" json:"pem"`
	Domains       string    `gorm:"type:varchar(256);not null" json:"domains"`
	CertURL       string    `gorm:"type:varchar(256);not null" json:"certURL"`
	Type          string    `gorm:"type:varchar(64);not null" json:"type"`
	Provider      string    `gorm:"type:varchar(64);not null" json:"provider"`
	Organization  string    `gorm:"type:varchar(64);not null" json:"organization"`
	DnsAccountID  uint      `gorm:"type:integer;not null" json:"dnsAccountId"`
	AcmeAccountID uint      `gorm:"type:integer;not null" json:"acmeAccountId"`
	AutoRenew     bool      `gorm:"type:varchar(64);not null" json:"autoRenew"`
	ExpireDate    time.Time `json:"expireDate"`
	StartDate     time.Time `json:"startDate"`

	AcmeAccount WebsiteAcmeAccount `json:"acmeAccount" gorm:"-:migration"`
	Websites    []Website          `json:"websites" gorm:"-:migration"`
}

func (WebsiteSSL) TableName

func (w WebsiteSSL) TableName() string

Jump to

Keyboard shortcuts

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