service

package
v0.0.0-...-9a2ebf3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExecRunning = "running"
	ExecFail    = "fail"
	ExecCancel  = "cancel"
	ExecSuccess = "success"
)
View Source
const (
	ExecTypeGroup = "group"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	// contains filtered or unexported fields
}

func NewLog

func NewLog(
	conf *conf.Config,
	repo repository.Log,
) *Log

func (*Log) GetLog

func (l *Log) GetLog(ctx kratosx.Context, id uint32) (*entity.Log, error)

GetLog 获取指定的日志信息

func (*Log) ListLog

func (l *Log) ListLog(ctx kratosx.Context, req *types.ListLogRequest) ([]*entity.Log, uint32, error)

ListLog 获取日志信息列表

type Task

type Task struct {
	// contains filtered or unexported fields
}

func NewTask

func NewTask(
	conf *conf.Config,
	repo repository.Task,
	worker repository.Worker,
	log repository.Log,
	taskClient repository.TaskClient,

) *Task

func (*Task) CancelExecTask

func (t *Task) CancelExecTask(ctx kratosx.Context, uuid string) error

CancelExecTask 取消执行任务

func (*Task) CreateTask

func (t *Task) CreateTask(ctx kratosx.Context, task *entity.Task) (uint32, error)

CreateTask 创建任务信息

func (*Task) CreateTaskGroup

func (t *Task) CreateTaskGroup(ctx kratosx.Context, tg *entity.TaskGroup) (uint32, error)

CreateTaskGroup 创建任务分组

func (*Task) DeleteTask

func (t *Task) DeleteTask(ctx kratosx.Context, id uint32) error

DeleteTask 删除任务信息

func (*Task) DeleteTaskGroup

func (t *Task) DeleteTaskGroup(ctx kratosx.Context, id uint32) error

DeleteTaskGroup 删除任务分组

func (*Task) ExecTask

func (t *Task) ExecTask(ctx kratosx.Context, id uint32) error

ExecTask 执行任务

func (*Task) GetTask

func (t *Task) GetTask(ctx kratosx.Context, id uint32) (*entity.Task, error)

GetTask 获取指定的任务信息

func (*Task) GetTaskGroup

func (t *Task) GetTaskGroup(ctx kratosx.Context, id uint32) (*entity.TaskGroup, error)

GetTaskGroup 获取指定的任务分组

func (*Task) ListTask

func (t *Task) ListTask(ctx kratosx.Context, req *types.ListTaskRequest) ([]*entity.Task, uint32, error)

ListTask 获取任务信息列表

func (*Task) ListTaskGroup

func (t *Task) ListTaskGroup(ctx kratosx.Context, req *types.ListTaskGroupRequest) ([]*entity.TaskGroup, uint32, error)

ListTaskGroup 获取任务分组列表

func (*Task) Scheduler

func (t *Task) Scheduler(ctx kratosx.Context, id uint32, spec string, force bool) error

func (*Task) UpdateTask

func (t *Task) UpdateTask(ctx kratosx.Context, task *entity.Task) error

UpdateTask 更新任务信息

func (*Task) UpdateTaskGroup

func (t *Task) UpdateTaskGroup(ctx kratosx.Context, tg *entity.TaskGroup) error

UpdateTaskGroup 更新任务分组

func (*Task) UpdateTaskStatus

func (t *Task) UpdateTaskStatus(ctx kratosx.Context, id uint32, status bool) error

UpdateTaskStatus 更新任务信息状态

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(
	conf *conf.Config,
	repo repository.Worker,
	taskClient repository.TaskClient,
) *Worker

func (*Worker) CreateWorker

func (w *Worker) CreateWorker(ctx kratosx.Context, worker *entity.Worker) (uint32, error)

CreateWorker 创建节点信息

func (*Worker) CreateWorkerGroup

func (w *Worker) CreateWorkerGroup(ctx kratosx.Context, wg *entity.WorkerGroup) (uint32, error)

CreateWorkerGroup 创建节点分组

func (*Worker) DeleteWorker

func (w *Worker) DeleteWorker(ctx kratosx.Context, id uint32) error

DeleteWorker 删除节点信息

func (*Worker) DeleteWorkerGroup

func (w *Worker) DeleteWorkerGroup(ctx kratosx.Context, id uint32) error

DeleteWorkerGroup 删除节点分组

func (*Worker) GetWorker

func (w *Worker) GetWorker(ctx kratosx.Context, req *types.GetWorkerRequest) (*entity.Worker, error)

GetWorker 获取指定的节点信息

func (*Worker) GetWorkerGroup

func (w *Worker) GetWorkerGroup(ctx kratosx.Context, id uint32) (*entity.WorkerGroup, error)

GetWorkerGroup 获取指定的节点分组

func (*Worker) ListWorker

func (w *Worker) ListWorker(ctx kratosx.Context, req *types.ListWorkerRequest) ([]*entity.Worker, uint32, error)

ListWorker 获取节点信息列表

func (*Worker) ListWorkerGroup

func (w *Worker) ListWorkerGroup(ctx kratosx.Context, req *types.ListWorkerGroupRequest) ([]*entity.WorkerGroup, uint32, error)

ListWorkerGroup 获取节点分组列表

func (*Worker) UpdateWorker

func (w *Worker) UpdateWorker(ctx kratosx.Context, worker *entity.Worker) error

UpdateWorker 更新节点信息

func (*Worker) UpdateWorkerGroup

func (w *Worker) UpdateWorkerGroup(ctx kratosx.Context, wg *entity.WorkerGroup) error

UpdateWorkerGroup 更新节点分组

func (*Worker) UpdateWorkerStatus

func (w *Worker) UpdateWorkerStatus(ctx kratosx.Context, id uint32, status bool) error

UpdateWorkerStatus 更新节点信息状态

Jump to

Keyboard shortcuts

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