task

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPolymorphicValue

func GetPolymorphicValue(taskType task.Type) string

func InitActivatedTasks added in v1.0.0

func InitActivatedTasks()

Types

type ConcreteTask

type ConcreteTask interface {
	FindOneById(id int64) (*task.DeployTask, error)
	Create(tx *gorm.DB, data map[string]any) (id int64, err error)
	Update(tx *gorm.DB, data map[string]any, id int64) error
	Delete(tx *gorm.DB, t *task.Task) error
	Start(ctx context.Context, t *task.Task) error
	Run(ctx context.Context, t *task.Task) error
	Stop(ctx context.Context, t *task.Task) error
}

func Select

func Select(taskType task.Type) ConcreteTask

type DeployTaskService

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

func (*DeployTaskService) Create

func (s *DeployTaskService) Create(tx *gorm.DB, data map[string]any) (int64, error)

func (*DeployTaskService) Delete

func (s *DeployTaskService) Delete(tx *gorm.DB, t *task.Task) error

func (*DeployTaskService) FindOneById

func (s *DeployTaskService) FindOneById(id int64) (*task.DeployTask, error)

func (*DeployTaskService) Run

func (s *DeployTaskService) Run(ctx context.Context, t *task.Task) error

func (*DeployTaskService) Start

func (s *DeployTaskService) Start(ctx context.Context, t *task.Task) error

func (*DeployTaskService) Stop

func (s *DeployTaskService) Stop(ctx context.Context, t *task.Task) error

func (*DeployTaskService) Update

func (s *DeployTaskService) Update(tx *gorm.DB, data map[string]any, id int64) error

type ScriptTaskService added in v1.0.0

type ScriptTaskService struct {
}

func GetScriptTaskService added in v1.0.0

func GetScriptTaskService() *ScriptTaskService

func (*ScriptTaskService) Create added in v1.0.0

func (*ScriptTaskService) Delete added in v1.0.0

func (s *ScriptTaskService) Delete(id int64) error

func (*ScriptTaskService) FindOneById added in v1.0.0

func (s *ScriptTaskService) FindOneById(id int64, preloads ...string) (*task.ScriptTask, error)

func (*ScriptTaskService) PageList added in v1.0.0

func (s *ScriptTaskService) PageList(keyword string, page, pageSize int) (*res.PageableData[*task.ScriptTask], error)

func (*ScriptTaskService) Run added in v1.0.0

func (s *ScriptTaskService) Run(uId int64, t *task.ScriptTask) error

func (*ScriptTaskService) Start added in v1.0.0

func (s *ScriptTaskService) Start(uId, id int64) error

func (*ScriptTaskService) Stop added in v1.0.0

func (s *ScriptTaskService) Stop(id int64) error

func (*ScriptTaskService) Update added in v1.0.0

func (s *ScriptTaskService) Update(id int64, info *req.ScriptTaskUpsertReq) error

type TaskService

type TaskService struct {
}

func GetTaskService

func GetTaskService() *TaskService

func (*TaskService) CreateTask

func (s *TaskService) CreateTask(info *req.TaskUpsertReq) error

func (*TaskService) DeleteTask

func (s *TaskService) DeleteTask(id int64) error

func (*TaskService) FindOneById

func (s *TaskService) FindOneById(id int64) (*task.Task, error)

func (*TaskService) PageList

func (s *TaskService) PageList(keyword string, page, pageSize int) (*res.PageableData[*dvRes.TaskRes], error)

func (*TaskService) StartTask

func (s *TaskService) StartTask(uId, id int64) error

func (*TaskService) StopTask

func (s *TaskService) StopTask(id int64) error

func (*TaskService) UpdateTask

func (s *TaskService) UpdateTask(id int64, info *req.TaskUpsertReq) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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