domain

package
v0.0.0-...-5746ace Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResultVmNotFound = BizErr{consts.BizVmNotExist, "Vm Not Found"}
)

Functions

This section is empty.

Types

type BizErr

type BizErr struct {
	Code consts.ResultCode `json:"code"`
	Msg  string            `json:"msg"`
}

func NewBizErr

func NewBizErr(msg string) BizErr

func NewBizErrWithCode

func NewBizErrWithCode(code consts.ResultCode, msg string) BizErr

func (BizErr) Error

func (e BizErr) Error() string

type Build

type Build struct {
	Version float64 `json:"version,omitempty"`
	QueueId uint    `json:"queueId,omitempty"`
	VmId    uint    `json:"vmId,omitempty"`
	ID      uint    `json:"id,omitempty"`
	Name    string  `json:"name,omitempty"`
	Desc    string  `json:"desc,omitempty"`

	BuildType  consts.BuildType  `json:"buildType,omitempty"`
	OsCateGory consts.OsCategory `json:"osCateGory,omitempty"`
	OsType     consts.OsType     `json:"osType,omitempty"`
	OsVersion  string            `json:"osVersion,omitempty"`
	OsLang     consts.OsLang     `json:"osLang,omitempty"`

	WorkDir    string `json:"workDir,omitempty"`
	ProjectDir string `json:"projectDir,omitempty"`

	Serial   string `json:"serial,omitempty"`
	Priority int    `json:"priority,omitempty"`
	NodeIp   string `json:"nodeIp,omitempty"`
	NodePort int    `json:"nodePort,omitempty"`
	DeviceIp string `json:"deviceIp,omitempty"`

	AppiumPort         int                `json:"appiumPort,omitempty"`
	BrowserType        consts.BrowserType `json:"browserType,omitempty"`
	BrowserVersion     string             `json:"browserVersion,omitempty"`
	SeleniumDriverPath string             `json:"seleniumDriverPath,omitempty"`

	AppPath     string `json:"appPath,omitempty"`
	ScriptUrl   string `json:"scriptUrl,omitempty"`
	ScmAddress  string `json:"scmAddress,omitempty"`
	ScmAccount  string `json:"scmAccount,omitempty"`
	ScmPassword string `json:"scmPassword,omitempty"`

	AppUrl          string `json:"appUrl,omitempty"`
	BuildCommands   string `json:"buildCommands,omitempty"`
	EnvVars         string `json:"envVars,omitempty"`
	ResultFiles     string `json:"resultFiles,omitempty"`
	KeepResultFiles bool   `json:"keepResultFiles,omitempty"`
	ResultPath      string `json:"resultPath,omitempty"`
	ResultMsg       string `json:"resultMsg,omitempty"`

	StartTime    *time.Time `json:"startTime,omitempty"`
	CompleteTime *time.Time `json:"completeTime,omitempty"`

	Progress consts.BuildProgress `json:"progress"`
	Status   consts.BuildStatus   `json:"status"`
}

type BuildHistory

type BuildHistory struct {
	Id         uint       `json:"id"`
	Progress   string     `json:"progress"`
	Status     string     `json:"status"`
	QueueId    uint       `json:"queueId"`
	NodeIp     string     `json:"nodeIp"`
	VncAddress string     `json:"vncAddress"`
	ResultPath string     `json:"resultPath"`
	CreatedAt  *time.Time `json:"createdAt"`

	OwnerType string `json:"ownerType"`
	OwnerId   uint   `json:"ownerId"`
}

type CciContainers

type CciContainers struct {
	Command   []string     `json:"command"`
	Image     string       `json:"image"`
	Name      string       `json:"name"`
	Resources CciResources `json:"resources"`
}

type CciLimits

type CciLimits struct {
	CPU    string `json:"cpu"`
	Memory string `json:"memory"`
}

type CciMetadata

type CciMetadata struct {
	Name string `json:"name"`
	Uid  string `json:"uid"`
}

type CciRepsCreate

type CciRepsCreate struct {
	APIVersion string       `json:"apiVersion"`
	Kind       string       `json:"kind"`
	Metadata   CciMetadata  `json:"metadata"`
	Spec       CciSpecTempl `json:"spec"`
}

type CciRepsDestroy

type CciRepsDestroy struct {
	APIVersion string      `json:"apiVersion"`
	Code       int         `json:"code"`
	Message    string      `json:"message"`
	Metadata   CciMetadata `json:"metadata"`
}

type CciReqCreate

type CciReqCreate struct {
	APIVersion string       `json:"apiVersion"`
	Kind       string       `json:"kind"`
	Metadata   CciMetadata  `json:"metadata"`
	SpecTempl  CciSpecTempl `json:"spec"`
}

type CciReqDestroy

type CciReqDestroy struct {
	Kind              string `json:"Kind"`
	APIVersion        string `json:"apiVersion"`
	PropagationPolicy string `json:"propagationPolicy"`
}

type CciRequests

type CciRequests struct {
	CPU    string `json:"cpu"`
	Memory string `json:"memory"`
}

type CciResources

type CciResources struct {
	Limits   CciLimits   `json:"limits"`
	Requests CciRequests `json:"requests"`
}

type CciSpec

type CciSpec struct {
	Containers       []CciContainers    `json:"containers"`
	ImagePullSecrets []ImagePullSecrets `json:"imagePullSecrets"`
	RestartPolicy    string             `json:"restartPolicy"`
}

type CciSpecTempl

type CciSpecTempl struct {
	Template CciTemplate `json:"template"`
}

type CciTemplate

type CciTemplate struct {
	Metadata CciMetadata `json:"metadata"`
	Spec     CciSpec     `json:"spec"`
}

type Container

type Container struct {
	Ident string
}

type ContainerInfo

type ContainerInfo struct {
	Name      string `json:"name" yaml:"name"`
	Image     string `json:"image" yaml:"image"`
	ImageId   string `json:"imageId" yaml:"imageId"`
	SshPort   int    `json:"sshPort" yaml:"sshPort"`
	HttpPort  int    `json:"sshPort" yaml:"httpPort"`
	HttpsPort int    `json:"sshPort" yaml:"httpsPort"`
}
type Cookie struct {
	Name     string    `json:"name" yaml:"name"`
	Value    string    `json:"value" yaml:"value"`
	Domain   string    `json:"domain" yaml:"domain"`
	Path     string    `json:"path" yaml:"path"`
	Expires  time.Time `json:"expires" yaml:"expires"`
	HttpOnly bool      `json:"httpOnly" yaml:"httpOnly"`
	Secure   bool      `json:"secure" yaml:"secure"`
	MaxAge   int       `json:"maxAge" yaml:"maxAge"`
	Raw      string    `json:"raw" yaml:"raw"`
}

type DeviceInst

type DeviceInst struct {
	DeviceSpec

	NodeIp           string               `json:"nodeIp"`
	NodePort         int                  `json:"rpcPort"`
	AppiumPort       int                  `json:"appiumPort"`
	DeviceStatus     consts.DeviceStatus  `json:"deviceStatus"`
	AppiumStatus     consts.ServiceStatus `json:"appiumStatus"`
	LastRegisterDate time.Time            `json:"lastRegisterDate"`
}

type DeviceSpec

type DeviceSpec struct {
	Serial           string `json:"serial"`
	Model            string `json:"model"`
	ApiLevel         int    `json:"apiLevel"`
	Version          string `json:"version"`
	Code             string `json:"code"`
	Os               string `json:"os"`
	Kernel           string `json:"kernel"`
	Ram              int    `json:"ram"`
	Rom              int    `json:"rom"`
	Cpu              string `json:"cpu"`
	Battery          int    `json:"battery"`
	Density          int    `json:"density"`
	DeviceIp         string `json:"deviceIp"`
	ResolutionHeight int    `json:"resolutionHeight"`
	ResolutionWidth  int    `json:"resolutionWidth"`
}

type Filed

type Filed struct {
	Condition string      `json:"condition"`
	Key       string      `json:"key"`
	Value     interface{} `json:"value"`
}

Filed 查询字段结构体

type HeaderItem

type HeaderItem struct {
	Name    string `json:"name" yaml:"name"`
	Desc    string `json:"desc" yaml:"desc"`
	Default string `json:"default" yaml:"default"`
}

type HeaderTempl

type HeaderTempl struct {
	Version   float64 `json:"version" yaml:"version"`
	Name      string  `json:"name" yaml:"name"`
	Desc      string  `json:"desc" yaml:"desc"`
	IsDefault bool    `json:"isDefault" yaml:"isDefault"`

	Items []HeaderItem `json:"items" yaml:"items"`
}

type Host

type Host struct {
	Name string `json:"name"`

	OsCategory consts.OsCategory `json:"osCategory"`
	OsType     consts.OsType     `json:"osType"`
	OsLang     consts.OsLang     `json:"osLang"`

	OsVersion string `json:"osVersion"`
	OsBuild   string `json:"osBuild"`
	OsBits    string `json:"osBits"`

	Ip      string `json:"ip"`
	Port    int    `json:"port"`
	WorkDir string `json:"workDir"`

	SshPort    int               `json:"sshPort"`
	VncAddress string            `json:"vncAddress"`
	Status     consts.HostStatus `json:"status"`

	TaskCount        int        `json:"taskCount"`
	LastRegisterDate *time.Time `json:"lastRegisterDate"`

	Vms []Vm `json:"vms" gorm:"-"`
}

type HostNode

type HostNode struct {
	Node
	Status consts.HostStatus `json:"status" yaml:"status"`
	Vms    []Vm
}

type ImagePullSecrets

type ImagePullSecrets struct {
	Name string `json:"name"`
}

type MultiPass

type MultiPass struct {
	Name        string `json:"name"`
	State       string `json:"state"`
	IPv4        string `json:"ipv4"`
	Release     string `json:"release"`
	ImageHash   string `json:"imageHash"`
	Load        string `json:"load"`
	DiskUsage   string `json:"diskUsage"`
	MemoryUsage string `json:"memoryUsage"`
	Mounts      string `json:"mounts"`
	Cpus        string `json:"cpus"`
	Memory      string `json:"memory"`
	Network     string `json:"network"`
	Image       string `json:"image"`
}

type Node

type Node struct {
	Version float64 `json:"version" yaml:"version"`
	Name    string  `json:"name" yaml:"name"`
	Desc    string  `json:"desc" yaml:"desc"`

	Ip      string `json:"ip" yaml:"ip"`
	Port    int    `json:"port" yaml:"port"`
	WorkDir string `json:"workDir" yaml:"workDir"`

	OsPlatform consts.OsCategory `json:"osPlatform" yaml:"osPlatform"`
	OsType     consts.OsType     `json:"osType" yaml:"osType"`
	SysLang    consts.OsLang     `json:"sysLang" yaml:"sysLang"`

	SshPort    int    `json:"sshPort" yaml:"sshPort"`
	VncAddress string `json:"vncAddress" yaml:"vncAddress"`

	Secret string `json:"secret" yaml:"secret"`

	LastRegisterDate time.Time `json:"lastRegisterDate" yaml:"lastRegisterDate"`
}

type Relate

type Relate struct {
	Value string
	Func  interface{}
}

type Result

type Result struct {
	Code    string      `json:"code"`
	Msg     string      `json:"msg"`
	Payload interface{} `json:"payload"`
}

func (*Result) Success

func (result *Result) Success(msg string)
type Search struct {
	Fields    []*Filed  `json:"fields"`
	Relations []*Relate `json:"relations"`
	OrderBy   string    `json:"order_by"`
	Sort      string    `json:"sort"`
	Limit     int       `json:"limit"`
	Offset    int       `json:"offset"`
}

Search 查询参数结构体

type SumRes

type SumRes struct {
	Total int64 `json:"total"`
}

type TestResult

type TestResult struct {
	TestSetId uint `json:"testSetId" yaml:"testSetId"`

	Version float64           `json:"version" yaml:"version"`
	Name    string            `json:"name" yaml:"name"`
	Code    consts.ResultCode `json:"code"`
	Msg     string            `json:"msg"`

	StartTime time.Time `json:"startTime" yaml:"startTime"`
	EndTime   time.Time `json:"endTime" yaml:"endTime"`
	Duration  int       `json:"duration" yaml:"duration"` // sec

	TotalNum  int `json:"totalNum" yaml:"totalNum"`
	PassNum   int `json:"passNum" yaml:"passNum"`
	FailNum   int `json:"failNum" yaml:"failNum"`
	MissedNum int `json:"missedNum" yaml:"missedNum"`

	Payload interface{} `json:"payload"`
}

func (*TestResult) Fail

func (result *TestResult) Fail(msg string)

func (*TestResult) Failf

func (result *TestResult) Failf(str string, args ...interface{})

func (*TestResult) IsSuccess

func (result *TestResult) IsSuccess() bool

func (*TestResult) Pass

func (result *TestResult) Pass(msg string)

func (*TestResult) Passf

func (result *TestResult) Passf(str string, args ...interface{})

type ValidRequest

type ValidRequest struct {
	Method _const.ValidMethod `json:"method"`
	Value  string             `json:"value"`

	Id   int    `json:"id"`
	Type string `json:"type"`
}

type ValidResp

type ValidResp struct {
	Pass bool `json:"pass"`
	Msg  bool `json:"msg"`
}

type Vm

type Vm struct {
	ID        int `json:"id"`
	BackingId int `json:"backingId"`
	HostId    int `json:"hostId"`

	Name        string `json:"name"`
	Tmpl        string `json:"Tmpl"`
	Backing     string `json:"backing"`
	ImagePath   string `json:"imagePath"`
	BackingPath string `json:"backingPath"`

	OsCategory consts.OsCategory `json:"osCategory"`
	OsType     consts.OsType     `json:"osType"`
	OsVersion  string            `json:"osVersion"`
	OsLang     consts.OsLang     `json:"osLang"`

	Status    consts.VmStatus `json:"status"`
	DestroyAt time.Time       `json:"destroyAt"`

	Ip         string `json:"ip"`
	Port       int    `json:"port"`
	MacAddress string `json:"macAddress"`
	RpcPort    int    `json:"rpcPort"`
	VncPort    int    `json:"vncPort"`
	WorkDir    string `json:"workDir"`

	DefPath          string `json:"defPath"`
	DiskSize         uint   `json:"diskSize"`   // M
	MemorySize       uint   `json:"memorySize"` // M
	CdromSys         string `json:"cdromSys"`
	CdromDriver      string `json:"cdromDriver"`
	ResolutionHeight int    `json:"resolutionHeight"`
	ResolutionWidth  int    `json:"resolutionWidth"`

	Secret          string    `json:"secret" yaml:"secret"`
	VncPortOnHost   int       `json:"vncPortOnHost"`
	AgentPortOnHost int       `json:"agentPortOnHost"`
	ZtfPortOnHost   int       `json:"ztfPortOnHost"`
	ZdPortOnHost    int       `json:"zdPortOnHost"`
	SshPortOnHost   int       `json:"sshPortOnHost"`
	Heartbeat       time.Time `json:"heartbeat"`
}

type VmAssert

type VmAssert struct {
	ID uint

	OsCategory consts.OsCategory
	OsType     consts.OsType
	OsVersion  string
	OsLang     consts.OsLang
}

type VmHost

type VmHost struct {
	HostId      uint
	VmBackingId uint
}

type VmReq

type VmReq struct {
	TemplId uint `json:"id"`

	Ip       string `json:"ip,omitempty"`
	Port     int    `json:"port,omitempty"`
	Username string `json:"-"`
	Password string `json:"-"`

	VmId     string `json:"vmId"`
	Computer string `json:"computer"`
}

Jump to

Keyboard shortcuts

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