hostAgentService

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: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInitService

func NewInitService()

Types

type AsyncExecutorService

type AsyncExecutorService struct {
}

func (*AsyncExecutorService) Exec

func (s *AsyncExecutorService) Exec(po *agentModel.Task, uuidStr string, opt func(*agentModel.Task) (consts.TaskStatus, string)) (
	status consts.TaskStatus, result string)

type DownloadService

type DownloadService struct {
	TaskService *TaskService `inject:""`

	TaskRepo *hostRepo.TaskRepo `inject:""`
}

func NewDownloadService

func NewDownloadService() *DownloadService

func (*DownloadService) AddTasks

func (s *DownloadService) AddTasks(req []v1.DownloadReq) (err error)

func (*DownloadService) CancelTask

func (s *DownloadService) CancelTask(taskId uint)

func (*DownloadService) RemoveTask

func (s *DownloadService) RemoveTask(req v1.DownloadReq)

func (*DownloadService) RestartTask

func (s *DownloadService) RestartTask(po agentModel.Task) (ret bool)

func (*DownloadService) StartTask

func (s *DownloadService) StartTask(po agentModel.Task)

func (*DownloadService) StopTask

func (s *DownloadService) StopTask(taskId uint)

type ExportService

type ExportService struct {
	TaskService    *TaskService               `inject:""`
	LibvirtService *kvmService.LibvirtService `inject:""`
	QemuService    *kvmService.QemuService    `inject:""`

	KvmService *kvmService.KvmService `inject:""`

	TaskRepo *hostRepo.TaskRepo `inject:""`
}

func NewExportService

func NewExportService() *ExportService

func (*ExportService) StartTask

func (s *ExportService) StartTask(po agentModel.Task)

type HostService

type HostService struct {
	VmService *hostKvmService.KvmService `inject:""`

	JobService  *agentService.JobService        `inject:""`
	TestService *agentTestingService.RunService `inject:""`
}

func NewHostService

func NewHostService() *HostService

func (*HostService) Check

func (s *HostService) Check()

func (*HostService) PassEnvsToContainerIfNeeded

func (s *HostService) PassEnvsToContainerIfNeeded(build *domain.Build)

func (*HostService) Register

func (s *HostService) Register(isBusy bool)

type InitService

type InitService struct {
}

func (*InitService) InitModels

func (s *InitService) InitModels()

type SnapService

type SnapService struct {
	SyncHeartbeatMap sync.Map
	TimeStamp        int64

	LibvirtService *kvmService.LibvirtService `inject:""`
	QemuService    *kvmService.QemuService    `inject:""`
	KvmService     *kvmService.KvmService     `inject:""`

	TaskRepo             *hostRepo.TaskRepo    `inject:""`
	TaskService          *TaskService          `inject:""`
	AsyncExecutorService *AsyncExecutorService `inject:""`
}

func NewAsyncExecutor

func NewAsyncExecutor() *SnapService

func NewSnapService

func NewSnapService() *SnapService

func (*SnapService) AddTasks

func (s *SnapService) AddTasks(req []v1.SnapTaskReq) (err error)

func (*SnapService) GetVmSnaps

func (s *SnapService) GetVmSnaps(vm string) (snaps []string)

func (*SnapService) ListSnap

func (s *SnapService) ListSnap(vm string) (ret []v1.SnapItemResp, err error)

ListSnap 列出快照

func (*SnapService) RemoveSnap

func (s *SnapService) RemoveSnap(req *v1.SnapTaskReq) (err error)

func (*SnapService) RemoveSnapsByVmName

func (s *SnapService) RemoveSnapsByVmName(vm string) (err error)

RemoveSnapsByVmName 删除虚拟机下所有快照

func (*SnapService) RemoveTask

func (s *SnapService) RemoveTask(req v1.DownloadReq)

func (*SnapService) StartCreateSnapTask

func (s *SnapService) StartCreateSnapTask(po agentModel.Task)

func (*SnapService) StartRevertSnapTask

func (s *SnapService) StartRevertSnapTask(po agentModel.Task)

type StatusService

type StatusService struct {
	LibvirtService *kvmService.LibvirtService `inject:""`
}

func NewStatusService

func NewStatusService() *StatusService

func (*StatusService) Check

type TaskService

type TaskService struct {
	DownloadService *DownloadService `inject:""`
	ExportService   *ExportService   `inject:""`
	SnapService     *SnapService     `inject:""`

	TaskRepo *hostRepo.TaskRepo `inject:""`
}

func NewTaskService

func NewTaskService() *TaskService

func (*TaskService) CheckTask

func (s *TaskService) CheckTask() (err error)

func (*TaskService) IsError

func (s *TaskService) IsError(po agentModel.Task) bool

func (*TaskService) IsTimeout

func (s *TaskService) IsTimeout(po agentModel.Task) bool

func (*TaskService) ListTask

func (s *TaskService) ListTask() (ret v1.ListTaskResp, err error)

func (*TaskService) NeedRetry

func (s *TaskService) NeedRetry(po agentModel.Task) bool

func (*TaskService) SubmitResult

func (s *TaskService) SubmitResult(task agentModel.Task) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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