Documentation ¶
Index ¶
- Variables
- type AppiumService
- type BuildService
- type ClusterService
- type CommonService
- type ContainerService
- type DeviceService
- type DockerImageService
- type EnvService
- type ExecService
- func (s *ExecService) AppiumTest(queue model.Queue)
- func (s *ExecService) CheckAll()
- func (s *ExecService) DestroyTimeout()
- func (s *ExecService) Exec(queue model.Queue)
- func (s *ExecService) Retry()
- func (s *ExecService) Run()
- func (s *ExecService) SeleniumTest(queue model.Queue)
- func (s *ExecService) SetTimeout()
- type InitService
- type IsoService
- type PermService
- type PlanService
- type PortainerService
- func (s *PortainerService) CreateContainer(queueId uint, image model.ContainerImage, computer model.Computer, ...) (container model.Container, err error)
- func (s *PortainerService) DestroyContainer(ident string, computer model.Computer, cluster model.Cluster) (err error)
- func (s *PortainerService) GetNodeTree(clusterItem *domain.ResItem) (err error)
- func (s *PortainerService) ListContainer(clusterItem *domain.ResItem) (containers []*model.Container, err error)
- type PveService
- func (s *PveService) CreateVm(hostName string, templ model.VmTempl, computer model.Computer, ...) (vmIdent string, err error)
- func (s *PveService) DestroyVm(ident string, cluster model.Cluster) (err error)
- func (s *PveService) GetNodeTree(clusterItem *domain.ResItem) (err error)
- func (s *PveService) ListVm(clusterItem *domain.ResItem) (vms []*model.Vm, err error)
- type QueueService
- func (s *QueueService) GenerateAppiumQueue(task model.Task)
- func (s *QueueService) GenerateFromTask(task model.Task)
- func (s *QueueService) GenerateSeleniumQueue(task model.Task)
- func (s *QueueService) GenerateUnitTestQueue(task model.Task)
- func (s *QueueService) SetQueueResult(queueId uint, progress _const.BuildProgress, status _const.BuildStatus)
- type ResService
- func (s *ResService) CreateContainer(queueId uint, image model.ContainerImage, computer model.Computer, ...) (container model.Container, err error)
- func (s *ResService) CreateVm(name string, templ model.VmTempl, computer model.Computer, ...) (vmIdent string, err error)
- func (s *ResService) DestroyByBuild(buildId uint)
- func (s *ResService) DestroyContainer(containerIdent string, computer model.Computer, cluster model.Cluster) (err error)
- func (s *ResService) DestroyTimeout()
- func (s *ResService) DestroyTimeoutContainer()
- func (s *ResService) DestroyTimeoutVm()
- func (s *ResService) DestroyVm(vmIdent string, cluster model.Cluster) (err error)
- func (s *ResService) ListContainers() (rootItem *domain.ResItem)
- func (s *ResService) ListVm() (rootItem *domain.ResItem)
- type RoleService
- func (s *RoleService) CreateRole(role *model.Role) error
- func (s *RoleService) GetRolesForUser(uid uint) []string
- func (s *RoleService) RolePermissions(role *model.Role) []*model.Permission
- func (s *RoleService) RoleTransform(role *model.Role) *transformer.Role
- func (s *RoleService) RolesTransform(roles []*model.Role) []*transformer.Role
- func (s *RoleService) UpdateRole(id uint, nr *model.Role) error
- type RpcService
- func (s *RpcService) AppiumTest(build model.Build) (result _domain.RpcResult)
- func (s *RpcService) ConvertVmToTempl(req _domain.PveReq) (result _domain.RpcResult)
- func (s *RpcService) CreateVm(req _domain.PveReq) (result _domain.RpcResult)
- func (s *RpcService) DestroyVm(req _domain.PveReq) (result _domain.RpcResult)
- func (s *RpcService) Request(ip string, port int, apiPath string, method string, param *interface{}) (rpcResult _domain.RpcResult)
- func (s *RpcService) SeleniumTest(build model.Build) (result _domain.RpcResult)
- func (s *RpcService) StartVm(req _domain.PveReq) (result _domain.RpcResult)
- func (s *RpcService) StopVm(req _domain.PveReq) (result _domain.RpcResult)
- type SeederService
- type SeleniumService
- type TaskService
- type UserService
- type VmService
- type VmTemplService
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AppiumService ¶
type AppiumService struct { QueueService *QueueService `inject:""` RpcService *RpcService `inject:""` DeviceRepo *repo.DeviceRepo `inject:""` BuildRepo *repo.BuildRepo `inject:""` }
func NewAppiumService ¶
func NewAppiumService() *AppiumService
type BuildService ¶
type BuildService struct { QueueService *QueueService `inject:""` BuildRepo *repo.BuildRepo `inject:""` }
func NewBuildService ¶
func NewBuildService() *BuildService
func (BuildService) SaveResult ¶
type ClusterService ¶
type ClusterService struct {
ClusterRepo *repo.ClusterRepo `inject:""`
}
func NewClusterService ¶
func NewClusterService() *ClusterService
func (*ClusterService) ListByType ¶
func (s *ClusterService) ListByType(tp string) (clusters []model.Cluster)
type CommonService ¶
type CommonService struct { CommonRepo *repo.CommonRepo `inject:""` CasbinService *middleware.CasbinService `inject:""` }
func NewCommonService ¶
func NewCommonService() *CommonService
func (*CommonService) GetPermissionsForUser ¶
func (s *CommonService) GetPermissionsForUser(uid uint) [][]string
GetPermissionsForUser 获取角色权限
func (*CommonService) GetRolesForUser ¶
func (s *CommonService) GetRolesForUser(uid uint) []string
GetRolesForUser 获取角色
type ContainerService ¶
type ContainerService struct { RpcService *RpcService `inject:""` MachineService *ResService `inject:""` ContainerRepo *repo.ContainerRepo `inject:""` ContainerImageRepo *repo.ContainerImageRepo `inject:""` ClusterRepo *repo.ClusterRepo `inject:""` ComputerRepo *repo.ComputerRepo `inject:""` }
func NewContainerService ¶
func NewContainerService() *ContainerService
func (*ContainerService) CreateByQueue ¶
func (s *ContainerService) CreateByQueue(queue model.Queue) (dockerId string, err error)
type DeviceService ¶
type DeviceService struct {
DeviceRepo *repo.DeviceRepo `inject:""`
}
func NewDeviceService ¶
func NewDeviceService() *DeviceService
func (*DeviceService) IsDeviceReady ¶
func (s *DeviceService) IsDeviceReady(device model.Device) bool
func (*DeviceService) Register ¶
func (s *DeviceService) Register(devices []_domain.DeviceInst) (result _domain.RpcResult)
type DockerImageService ¶
type DockerImageService struct {
DockerImageRepo *repo.ContainerImageRepo `inject:""`
}
func NewDockerImageService ¶
func NewDockerImageService() *DockerImageService
type EnvService ¶
func NewEnvService ¶
func NewEnvService() *EnvService
func (*EnvService) List ¶
func (s *EnvService) List() ( osPlatforms []model.OsPlatform, osTypes []model.OsType, osLangs []model.OsLang, browserTypes []model.BrowserType)
type ExecService ¶
type ExecService struct { ResService *ResService `inject:""` DeviceService *DeviceService `inject:""` VmService *VmService `inject:""` AppiumService *AppiumService `inject:""` SeleniumService *SeleniumService `inject:""` TaskService *TaskService `inject:""` ExecRepo *repo.ExecRepo `inject:""` QueueRepo *repo.QueueRepo `inject:""` DeviceRepo *repo.DeviceRepo `inject:""` VmRepo *repo.VmRepo `inject:""` TaskRepo *repo.TaskRepo `inject:""` }
func NewExecService ¶
func NewExecService() *ExecService
func (*ExecService) AppiumTest ¶
func (s *ExecService) AppiumTest(queue model.Queue)
func (*ExecService) CheckAll ¶
func (s *ExecService) CheckAll()
func (*ExecService) DestroyTimeout ¶
func (s *ExecService) DestroyTimeout()
func (*ExecService) Exec ¶
func (s *ExecService) Exec(queue model.Queue)
func (*ExecService) Retry ¶
func (s *ExecService) Retry()
func (*ExecService) Run ¶
func (s *ExecService) Run()
func (*ExecService) SeleniumTest ¶
func (s *ExecService) SeleniumTest(queue model.Queue)
func (*ExecService) SetTimeout ¶
func (s *ExecService) SetTimeout()
type InitService ¶
type InitService struct { }
func (*InitService) Init ¶
func (s *InitService) Init()
type IsoService ¶
func NewIsoService ¶
func NewIsoService() *IsoService
type PermService ¶
func NewPermService ¶
func NewPermService() *PermService
type PlanService ¶
type PlanService struct { TaskService *TaskService `inject:""` PlanRepo *repo.PlanRepo `inject:""` }
func NewPlanService ¶
func NewPlanService() *PlanService
func (*PlanService) SetProgress ¶
func (s *PlanService) SetProgress(id uint, progress _const.BuildProgress)
type PortainerService ¶
type PortainerService struct { }
func NewPortainerService ¶
func NewPortainerService() *PortainerService
func (*PortainerService) CreateContainer ¶
func (*PortainerService) DestroyContainer ¶
func (*PortainerService) GetNodeTree ¶
func (s *PortainerService) GetNodeTree(clusterItem *domain.ResItem) (err error)
func (*PortainerService) ListContainer ¶
type PveService ¶
type PveService struct { }
func NewPveService ¶
func NewPveService() *PveService
func (*PveService) DestroyVm ¶
func (s *PveService) DestroyVm(ident string, cluster model.Cluster) (err error)
func (*PveService) GetNodeTree ¶
func (s *PveService) GetNodeTree(clusterItem *domain.ResItem) (err error)
type QueueService ¶
type QueueService struct { TaskService *TaskService `inject:""` QueueRepo *repo.QueueRepo `inject:""` DeviceRepo *repo.DeviceRepo `inject:""` VmTemplRepo *repo.VmTemplRepo `inject:""` DockerImageRepo *repo.ContainerImageRepo `inject:""` }
func NewQueueService ¶
func NewQueueService() *QueueService
func (*QueueService) GenerateAppiumQueue ¶
func (s *QueueService) GenerateAppiumQueue(task model.Task)
func (*QueueService) GenerateFromTask ¶
func (s *QueueService) GenerateFromTask(task model.Task)
func (*QueueService) GenerateSeleniumQueue ¶
func (s *QueueService) GenerateSeleniumQueue(task model.Task)
func (*QueueService) GenerateUnitTestQueue ¶
func (s *QueueService) GenerateUnitTestQueue(task model.Task)
func (*QueueService) SetQueueResult ¶
func (s *QueueService) SetQueueResult(queueId uint, progress _const.BuildProgress, status _const.BuildStatus)
type ResService ¶
type ResService struct { ClusterService *ClusterService `inject:""` VmPlatform serviceInterface.VmPlatformInterface ContainerPlatform serviceInterface.ContainerPlatformInterface ClusterRepo *repo.ClusterRepo `inject:""` ComputerRepo *repo.ComputerRepo `inject:""` BuildRepo *repo.BuildRepo `inject:""` VmRepo *repo.VmRepo `inject:""` ContainerRepo *repo.ContainerRepo `inject:""` VmTemplRepo *repo.VmTemplRepo `inject:""` ContainerImageRepo *repo.ContainerImageRepo `inject:""` }
func NewResService ¶
func NewResService() *ResService
func (*ResService) CreateContainer ¶
func (*ResService) DestroyByBuild ¶
func (s *ResService) DestroyByBuild(buildId uint)
func (*ResService) DestroyContainer ¶
func (*ResService) DestroyTimeout ¶
func (s *ResService) DestroyTimeout()
func (*ResService) DestroyTimeoutContainer ¶
func (s *ResService) DestroyTimeoutContainer()
func (*ResService) DestroyTimeoutVm ¶
func (s *ResService) DestroyTimeoutVm()
func (*ResService) DestroyVm ¶
func (s *ResService) DestroyVm(vmIdent string, cluster model.Cluster) (err error)
func (*ResService) ListContainers ¶
func (s *ResService) ListContainers() (rootItem *domain.ResItem)
func (*ResService) ListVm ¶
func (s *ResService) ListVm() (rootItem *domain.ResItem)
type RoleService ¶
type RoleService struct { CommonService RoleRepo *repo.RoleRepo `inject:""` PermRepo *repo.PermRepo `inject:""` CasbinService *middleware.CasbinService `inject:""` }
func NewRoleService ¶
func NewRoleService() *RoleService
func (*RoleService) CreateRole ¶
func (s *RoleService) CreateRole(role *model.Role) error
CreateRole create role
func (*RoleService) GetRolesForUser ¶
func (s *RoleService) GetRolesForUser(uid uint) []string
func (*RoleService) RolePermissions ¶
func (s *RoleService) RolePermissions(role *model.Role) []*model.Permission
RolePermissions get role's permissions
func (*RoleService) RoleTransform ¶
func (s *RoleService) RoleTransform(role *model.Role) *transformer.Role
func (*RoleService) RolesTransform ¶
func (s *RoleService) RolesTransform(roles []*model.Role) []*transformer.Role
func (*RoleService) UpdateRole ¶
func (s *RoleService) UpdateRole(id uint, nr *model.Role) error
UpdateRole update role
type RpcService ¶
type RpcService struct{}
func NewRpcService ¶
func NewRpcService() *RpcService
func (*RpcService) AppiumTest ¶
func (s *RpcService) AppiumTest(build model.Build) (result _domain.RpcResult)
func (*RpcService) ConvertVmToTempl ¶
func (s *RpcService) ConvertVmToTempl(req _domain.PveReq) (result _domain.RpcResult)
func (*RpcService) CreateVm ¶
func (s *RpcService) CreateVm(req _domain.PveReq) (result _domain.RpcResult)
func (*RpcService) DestroyVm ¶
func (s *RpcService) DestroyVm(req _domain.PveReq) (result _domain.RpcResult)
func (*RpcService) SeleniumTest ¶
func (s *RpcService) SeleniumTest(build model.Build) (result _domain.RpcResult)
type SeederService ¶
type SeederService struct { InitService *InitService `inject:""` RoleService *RoleService `inject:""` UserService *UserService `inject:""` CommonRepo *repo.CommonRepo `inject:""` UserRepo *repo.UserRepo `inject:""` RoleRepo *repo.RoleRepo `inject:""` PermRepo *repo.PermRepo `inject:""` }
func NewSeeder ¶
func NewSeeder() *SeederService
func (*SeederService) AddPerms ¶
func (s *SeederService) AddPerms()
func (*SeederService) AutoMigrates ¶
func (s *SeederService) AutoMigrates()
AutoMigrates 重置数据表 libs.DB.DropTableIfExists 删除存在数据表 libs.DB.AutoMigrate 重建数据表
func (*SeederService) CreateAdminRole ¶
func (s *SeederService) CreateAdminRole()
CreateAdminRole 新建管理角色
func (*SeederService) CreateAdminUser ¶
func (s *SeederService) CreateAdminUser()
CreateAdminUser 新建管理员
func (*SeederService) Run ¶
func (s *SeederService) Run()
type SeleniumService ¶
type SeleniumService struct { RpcService *RpcService `inject:""` QueueService *QueueService `inject:""` VmRepo *repo.VmRepo `inject:""` BuildRepo *repo.BuildRepo `inject:""` }
func NewSeleniumService ¶
func NewSeleniumService() *SeleniumService
func (*SeleniumService) Run ¶
func (s *SeleniumService) Run(queue model.Queue) (result _domain.RpcResult)
func (*SeleniumService) SaveResult ¶
func (s *SeleniumService) SaveResult(buildResult _domain.RpcResult, resultPath string)
type TaskService ¶
type TaskService struct { QueueService *QueueService `inject:""` TaskRepo *repo.TaskRepo `inject:""` QueueRepo *repo.QueueRepo `inject:""` DeviceRepo *repo.DeviceRepo `inject:""` }
func NewTaskService ¶
func NewTaskService() *TaskService
func (*TaskService) CheckCompleted ¶
func (s *TaskService) CheckCompleted(taskId uint)
func (*TaskService) GenerateFromPlan ¶
func (s *TaskService) GenerateFromPlan(plan *model.Plan) (count int)
func (*TaskService) SetProgress ¶
func (s *TaskService) SetProgress(id uint, progress _const.BuildProgress)
type UserService ¶
type UserService struct { UserRepo *repo.UserRepo `inject:""` TokenRepo *repo.TokenRepo `inject:""` CasbinService *middleware.CasbinService `inject:""` }
func NewUserService ¶
func NewUserService() *UserService
func (*UserService) CheckLogin ¶
func (s *UserService) CheckLogin(ctx iris.Context, u *model.User, password string) (*model.Token, int64, string)
CheckLogin check login user
func (*UserService) CreateUser ¶
func (s *UserService) CreateUser(u *model.User) error
CreateUser create user
func (*UserService) UpdateRefreshToken ¶
func (s *UserService) UpdateRefreshToken(id uint, token string)
func (*UserService) UpdateUserById ¶
func (s *UserService) UpdateUserById(id uint, nu *model.User) error
UpdateUserById update user by id
type VmService ¶
type VmService struct { RpcService *RpcService `inject:""` ResService *ResService `inject:""` VmRepo *repo.VmRepo `inject:""` VmTemplRepo *repo.VmTemplRepo `inject:""` ClusterRepo *repo.ClusterRepo `inject:""` ComputerRepo *repo.ComputerRepo `inject:""` IsoRepo *repo.IsoRepo `inject:""` QueueRepo *repo.QueueRepo `inject:""` }
func NewInitService ¶
func NewInitService() *VmService
func NewVmService ¶
func NewVmService() *VmService
type VmTemplService ¶
type VmTemplService struct { VmTemplRepo *repo.VmTemplRepo `inject:""` ComputerRepo *repo.ComputerRepo `inject:""` }
func NewVmTemplService ¶
func NewVmTemplService() *VmTemplService
func (*VmTemplService) CreateByComputer ¶
func (s *VmTemplService) CreateByComputer(item domain.ResItem) (templ model.VmTempl)
func (*VmTemplService) GetByIdent ¶
func (s *VmTemplService) GetByIdent(ident, computer, cluster string) (templ model.VmTempl)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.