Documentation
¶
Index ¶
- Variables
- func GenPveReq(vmPo Vm) (req _domain.PveReq)
- func GenVmTo(vmPo Vm) (to _domain.Vm)
- func NewBuildTo(build Build) _domain.BuildTo
- type Avatar
- type BaseModel
- type BrowserType
- type Build
- type Cluster
- type Computer
- type Container
- type ContainerImage
- type Device
- type EnvBase
- type Iso
- type OsLang
- type OsPlatform
- type OsType
- type Permission
- type Plan
- type Queue
- type Role
- type Task
- type Token
- type User
- type Vm
- type VmTempl
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Models = []interface{}{ &User{}, &Role{}, &Permission{}, &OsPlatform{}, &OsType{}, &OsLang{}, &BrowserType{}, &Device{}, &Iso{}, &Queue{}, &Plan{}, &Task{}, &Queue{}, &Build{}, &Cluster{}, &Computer{}, &ContainerImage{}, &Container{}, &VmTempl{}, &Vm{}, } )
Functions ¶
func NewBuildTo ¶
Types ¶
type Avatar ¶
type Avatar struct {
Avatar string `type:longText" json:"avatar" validate:"required" comment:"头像"`
}
type BrowserType ¶
type BrowserType struct {
EnvBase
Name _const.BrowserType `json:"name"`
}
func (BrowserType) TableName ¶
func (BrowserType) TableName() string
type Build ¶
type Build struct {
BaseModel
base.TestObject
base.TestEnv
QueueId uint `json:"queueId,omitempty"`
// info
Name string `json:"name,omitempty"`
// job
BuildType _const.BuildType `json:"buildType,omitempty"`
Priority int `json:"priority,omitempty"`
// env
ComputerIp string `json:"computerIp,omitempty"`
ComputerPort int `json:"computerPort,omitempty"`
AppiumPort int `json:"appiumPort,omitempty"`
// status
StartTime time.Time `json:"startTime,omitempty"`
CompleteTime time.Time `json:"completeTime,omitempty"`
Progress _const.BuildProgress `json:"progress,omitempty"`
Status _const.BuildStatus `json:"status,omitempty"`
}
func NewBuildDetail ¶
type Cluster ¶
type Cluster struct {
BaseModel
base.TestEnv
Name string `json:"name"`
Type string `json:"type"`
Ip string `json:"ip"`
Port int `json:"port"`
WorkDir string `json:"workDir,omitempty"`
Username string `json:"username"`
Password string `json:"password"`
SshPort int `json:"sshPort,omitempty"`
VncPort int `json:"vncPort,omitempty"`
Status _const.HostStatus `json:"status"`
LastRegisterDate time.Time `json:"lastRegisterDate"`
TaskCount int `gorm:"-" json:"taskCount"`
}
func NewCluster ¶
func NewCluster() Cluster
type Computer ¶
type Computer struct {
BaseModel
Cluster string `json:"cluster"`
InstCount int `gorm:"default:0" json:"instCount"`
TaskCount int `gorm:"-" json:"taskCount"`
Ident string `json:"ident"`
Type string `json:"type"`
Name string `json:"name"`
Ip string `json:"ip"`
Port int `son:"port"`
WorkDir string `json:"workDir,omitempty"`
Username string `json:"username"`
Password string `json:"password"`
SshPort int `json:"sshPort,omitempty"`
VncPort int `json:"vncPort,omitempty"`
Status _const.HostStatus `json:"status"`
}
func NewComputer ¶
func NewComputer() Computer
type Container ¶
type Container struct {
BaseModel
Mac string `json:"mac,omitempty"`
Name string `json:"name,omitempty"`
Ip string `json:"ip,omitempty"`
Port int `json:"port,omitempty"`
SshPort int `json:"sshPort,omitempty"`
VncPort int `json:"vncPort,omitempty"`
Status _const.VmStatus `json:"status,omitempty"`
Msg string `json:"msg,omitempty"`
WorkDir string `json:"workDir,omitempty"`
HostId uint `json:"hostId,omitempty"`
ImageId uint `json:"imageId,omitempty"`
HostName string `json:"hostName,omitempty"`
DefPath string `json:"defPath,omitempty"`
ImagePath string `json:"imagePath,omitempty"`
DiskSize int `json:"diskSize,omitempty"`
MemorySize int `json:"memorySize,omitempty"`
DestroyAt time.Time `json:"destroyAt,omitempty"`
LastRegisterDate time.Time `json:"lastRegisterDate,omitempty"`
Ident string `json:"ident"`
ComputerId uint `json:"computerId"`
ClusterId uint `json:"clusterId"`
}
func (Container) GenContainerTo ¶
type ContainerImage ¶
type ContainerImage struct {
BaseModel
base.TestEnv
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Size int `json:"size,omitempty"`
ResolutionHeight int `json:"resolutionHeight,omitempty"`
ResolutionWidth int `json:"resolutionWidth,omitempty"`
SuggestDiskSize int `json:"suggestDiskSize,omitempty"`
SuggestMemorySize int `json:"suggestMemorySize,omitempty"`
SysIsoId uint `json:"sysIsoId,omitempty"`
DriverIsoId uint `json:"driverIsoId,omitempty"`
Ident string `json:"ident"`
Computer string `json:"computer"`
Cluster string `json:"cluster"`
}
func (ContainerImage) TableName ¶
func (ContainerImage) TableName() string
type Device ¶
type Device struct {
BaseModel
base.TestEnv
// from computer register
_domain.DeviceInst
// info to maintain
Name string `json:"name,omitempty"`
Make string `json:"make,omitempty"`
Brand string `json:"brand,omitempty"`
Series string `json:"series,omitempty"`
CpuMake string `json:"cpuMake,omitempty"`
CpuModel string `json:"cpuModel,omitempty"`
Memory int `json:"memory,omitempty"`
Storage int `json:"storage,omitempty"`
BatteryCapacity int `json:"batteryCapacity,omitempty"`
}
type Iso ¶
type Iso struct {
BaseModel
base.TestEnv
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Size int `json:"size,omitempty"`
ResolutionHeight int `json:"resolutionHeight,omitempty"`
ResolutionWidth int `json:"resolutionWidth,omitempty"`
SuggestDiskSize int `json:"suggestDiskSize,omitempty"`
SuggestMemorySize int `json:"suggestMemorySize,omitempty"`
}
type OsPlatform ¶
type OsPlatform struct {
EnvBase
Name _const.OsPlatform `json:"name"`
}
func (OsPlatform) TableName ¶
func (OsPlatform) TableName() string
type OsType ¶
type Permission ¶
type Permission struct {
BaseModel
Name string `gorm:"not null;type:varchar(256)" json:"name" validate:"required,gte=4,lte=50" comment:"名称"`
DisplayName string `gorm:"type:varchar(256)" json:"displayName" comment:"显示名称"`
Description string `gorm:"type:varchar(256)" json:"description" comment:"描述"`
Act string `gorm:"type:varchar(256)" json:"act" comment:"动作"`
}
type Plan ¶
type Plan struct {
BaseModel
base.TestObject
// info
Name string `json:"name,omitempty"`
UserName string `json:"userName,omitempty"`
// job
BuildType _const.BuildType `json:"buildType,omitempty"`
Priority int `json:"priority,omitempty"`
GroupId uint `json:"groupId,omitempty"`
// env
Environments []base.TestEnv `gorm:"-"`
// status
Progress _const.BuildProgress `json:"progress,omitempty"`
Status _const.BuildStatus `json:"status,omitempty"`
StartTime time.Time `json:"startTime,omitempty"`
PendingTime time.Time `json:"pendingTime,omitempty"`
ResultTime time.Time `json:"resultTime,omitempty"`
}
type Queue ¶
type Queue struct {
BaseModel
base.TestObject
base.TestEnv
// info
Name string `json:"name,omitempty"`
// job
BuildType _const.BuildType `json:"buildType,omitempty"`
Priority int `json:"priority,omitempty"`
GroupId uint `json:"groupId,omitempty"`
PlanId uint `json:"planId,omitempty"`
TaskId uint `json:"taskId,omitempty"`
// status
Progress _const.BuildProgress `json:"progress,omitempty"`
Status _const.BuildStatus `json:"status,omitempty"`
StartTime time.Time `json:"startTime,omitempty"`
PendingTime time.Time `json:"pendingTime,omitempty"`
ResultTime time.Time `json:"resultTime,omitempty"`
TimeoutTime time.Time `json:"timeoutTime,omitempty"`
Retry int `json:"retry,omitempty"`
}
func NewQueueDetail ¶
type Role ¶
type Role struct {
BaseModel
Name string `gorm:"unique;not null; type:varchar(256)" json:"name" validate:"required,gte=4,lte=50" comment:"名称"`
DisplayName string `gorm:"type:varchar(256)" json:"displayName" comment:"显示名称"`
Description string `gorm:"type:varchar(256)" json:"description" comment:"描述"`
PermIds []uint `gorm:"-" json:"perm_ids" comment:"权限id"`
}
type Task ¶
type Task struct {
BaseModel
base.TestObject
base.TestEnv
// info
Name string `json:"name,omitempty"`
UserName string `json:"userName,omitempty"`
// job
BuildType _const.BuildType `json:"buildType,omitempty"`
Priority int `json:"priority,omitempty"`
GroupId uint `json:"groupId,omitempty"`
PlanId uint `json:"planId,omitempty"`
// env
Environment base.TestEnv `gorm:"-"`
// status
Progress _const.BuildProgress `json:"progress,omitempty"`
Status _const.BuildStatus `json:"status,omitempty"`
StartTime time.Time `json:"startTime,omitempty"`
PendingTime time.Time `json:"pendingTime,omitempty"`
ResultTime time.Time `json:"resultTime,omitempty"`
}
type User ¶
type User struct {
gorm.Model
Name string `gorm:"not null; type:varchar(60)" json:"name" validate:"required,gte=2,lte=50" comment:"用户名"`
Username string `gorm:"username;unique;not null;type:varchar(60)" json:"username" validate:"required,gte=2,lte=50" comment:"名称"`
Password string `gorm:"type:varchar(100)" json:"password" comment:"密码"`
Intro string `gorm:"not null; type:varchar(512)" json:"introduction" comment:"简介"`
Avatar string `gorm:"type:longText" json:"avatar" comment:"头像"`
Token string `gorm:"type:varchar(128)" json:"token" comment:"令牌"`
TokenUpdatedTime time.Time `json:"tokenUpdatedTime" comment:"令牌更新时间"`
RoleIds []uint `gorm:"-" json:"role_ids" validate:"required" comment:"角色"`
}
type Vm ¶
type Vm struct {
BaseModel
base.TestEnv
Mac string `json:"mac,omitempty"`
Name string `json:"name,omitempty"`
Ip string `json:"ip,omitempty"`
Port int `json:"port,omitempty"`
SshPort int `json:"sshPort,omitempty"`
VncPort int `json:"vncPort,omitempty"`
Status _const.VmStatus `json:"status,omitempty"`
Msg string `json:"msg,omitempty"`
WorkDir string `json:"workDir,omitempty"`
HostId uint `json:"hostId,omitempty"`
TemplImageId uint `json:"templImageId,omitempty"`
CdromSysId uint `json:"cdromSysId,omitempty"`
CdromDriverId uint `json:"cdromDriverId,omitempty"`
HostName string `json:"hostName,omitempty"`
DefPath string `json:"defPath,omitempty"`
ImagePath string `json:"imagePath,omitempty"`
BackingImagePath string `json:"backingImagePath,omitempty"`
DiskSize int `json:"diskSize,omitempty"`
MemorySize int `json:"memorySize,omitempty"`
CdromSys string `json:"cdromSys,omitempty"`
CdromDriver string `json:"cdromDriver,omitempty"`
ResolutionHeight int `json:"resolutionHeight,omitempty"`
ResolutionWidth int `json:"resolutionWidth,omitempty"`
DestroyAt time.Time `json:"destroyAt,omitempty"`
LastRegisterDate time.Time `gorm:"json:"lastRegisterDate,omitempty"`
Ident string `json:"ident"`
Computer string `json:"computer"`
Cluster string `json:"cluster"`
ComputerId uint `json:"computerId"`
ClusterId uint `json:"clusterId"`
}
type VmTempl ¶
type VmTempl struct {
BaseModel
base.TestEnv
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Size int `json:"size,omitempty"`
ResolutionHeight int `json:"resolutionHeight,omitempty"`
ResolutionWidth int `json:"resolutionWidth,omitempty"`
SuggestDiskSize int `json:"suggestDiskSize,omitempty"`
SuggestMemorySize int `json:"suggestMemorySize,omitempty"`
SysIsoId uint `json:"sysIsoId,omitempty"`
DriverIsoId uint `json:"driverIsoId,omitempty"`
Ident string `json:"ident"`
Computer string `json:"computer"`
Cluster string `json:"cluster"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.