model

package
v0.1.0-beta-3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CDNStatusActive   = "active"
	CDNStatusInactive = "inactive"
)
View Source
const (
	SchedulerStatusActive   = "active"
	SchedulerStatusInactive = "inactive"
)
View Source
const (
	UserStateEnabled  = "enable"
	UserStateDisabled = "disable"
)

Variables

This section is empty.

Functions

func Paginate

func Paginate(page, perPage int) func(db *gorm.DB) *gorm.DB

Types

type CDN

type CDN struct {
	Model
	HostName     string `gorm:"column:host_name;size:256;uniqueIndex;not null" json:"host_name"`
	IDC          string `gorm:"column:idc;size:1024" json:"idc"`
	Location     string `gorm:"column:location;size:1024" json:"location"`
	IP           string `gorm:"column:ip;size:256;not null" json:"ip"`
	Port         int32  `gorm:"column:port;not null" json:"port"`
	DownloadPort int32  `gorm:"column:download_port;not null" json:"download_port"`
	Status       string `gorm:"type:enum('active', 'inactive');default:'inactive'" json:"status"`
	CDNClusterID *uint
	CDNCluster   CDNCluster `json:"-"`
}

type CDNCluster

type CDNCluster struct {
	Model
	Name              string             `gorm:"column:name;size:256;uniqueIndex;not null" json:"name"`
	BIO               string             `gorm:"column:bio;size:1024" json:"bio"`
	Config            datatypes.JSONMap  `gorm:"column:config;not null" json:"config"`
	SchedulerClusters []SchedulerCluster `gorm:"many2many:cdn_cluster_scheduler_cluster;" json:"-"`
	CDNs              []CDN              `json:"-"`
	SecurityGroupID   *uint
	SecurityGroup     SecurityGroup `json:"-"`
}

type Model

type Model struct {
	ID        uint           `gorm:"primarykey" json:"id"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type Scheduler

type Scheduler struct {
	Model
	HostName           string            `gorm:"column:host_name;size:256;uniqueIndex;not null" json:"host_name"`
	VIPs               string            `gorm:"column:vips;size:1024" json:"vips"`
	IDC                string            `gorm:"column:idc;size:1024" json:"idc"`
	Location           string            `gorm:"column:location;size:1024" json:"location"`
	NetConfig          datatypes.JSONMap `gorm:"column:net_config" json:"net_config"`
	IP                 string            `gorm:"column:ip;size:256;not null" json:"ip"`
	Port               int32             `gorm:"column:port;not null" json:"port"`
	Status             string            `gorm:"type:enum('active', 'inactive');default:'inactive'" json:"status"`
	SchedulerClusterID *uint
	SchedulerCluster   SchedulerCluster `json:"-"`
}

type SchedulerCluster

type SchedulerCluster struct {
	Model
	Name            string            `gorm:"column:name;size:256;uniqueIndex;not null" json:"name"`
	BIO             string            `gorm:"column:bio;size:1024" json:"bio"`
	Config          datatypes.JSONMap `gorm:"column:config;not null" json:"config"`
	ClientConfig    datatypes.JSONMap `gorm:"column:client_config;not null" json:"client_config"`
	CDNClusters     []CDNCluster      `gorm:"many2many:cdn_cluster_scheduler_cluster;" json:"-"`
	Schedulers      []Scheduler       `json:"-"`
	SecurityGroupID *uint
	SecurityGroup   SecurityGroup `json:"-"`
}

type SecurityGroup

type SecurityGroup struct {
	Model
	Name              string             `gorm:"column:name;size:256;uniqueIndex;not null" json:"name"`
	BIO               string             `gorm:"column:bio;size:1024" json:"bio"`
	Domain            string             `gorm:"column:domain;size:256;uniqueIndex;not null" json:"domain"`
	ProxyDomain       string             `gorm:"column:proxy_domain;size:1024" json:"proxy_domain"`
	SchedulerClusters []SchedulerCluster `json:"-"`
	CDNClusters       []CDNCluster       `json:"-"`
}

type User

type User struct {
	Model
	Email             string `gorm:"column:email;size:256;uniqueIndex;not null" json:"email"`
	Name              string `gorm:"column:name;size:256;uniqueIndex;not null" json:"name"`
	EncryptedPassword string `gorm:"column:encrypted_password;size:1024" json:"-"`
	Avatar            string `gorm:"column:avatar;size:256" json:"avatar"`
	Phone             string `gorm:"column:phone;size:256" json:"phone"`
	PrivateToken      string `gorm:"column:private_token;size:256" json:"private_token"`
	State             string `gorm:"type:enum('enable', 'disable');default:'enable'" json:"state"`
	Location          string `gorm:"column:location;size:1024" json:"location"`
	Bio               string `gorm:"column:bio;size:1024" json:"bio"`
}

Jump to

Keyboard shortcuts

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