task

package
v0.0.0-...-0eed87a Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_STOP = "stop"
	STATUS_RUN  = "run"
	STATUS_DEL  = "del"

	GET    = "GET"
	POST   = "POST"
	PUT    = "PUT"
	DELETE = "DELETE"
)

Variables

View Source
var SORT_MAP = map[string]string{
	"createTime": "create_time",
	"start_time": "start_time",
	"duration":   "duration",
}

Functions

This section is empty.

Types

type TaskService

type TaskService interface {
	RunTask(ctx context.Context)

	Add(ctx context.Context, task *model.Task) error
	Update(ctx context.Context, userId int64, task *model.Task) error
	PageByOption(ctx context.Context, opt *types.TaskOption) (*types.Page[*types.TaskDTO], error)
	Start(ctx context.Context, userId int64, id int64) error
	Stop(ctx context.Context, userId int64, id int64) error
	Del(ctx context.Context, userId int64, id int64) error

	DoOnce(ctx context.Context, uid int64, id int64) error
	RunTaskById(ctx context.Context, taskId int64) error
	DelEntry(ctx context.Context, taskId int64)

	UpdateUser(ctx context.Context, tcu *types.TaskChangeUser) (int64, error)
	StartBatch(ctx context.Context, userId int64, tbatch *types.TaskBatch) (int64, error)
	StopBatch(ctx context.Context, userId int64, tbatch *types.TaskBatch) (int64, error)
	DelBatch(ctx context.Context, userId int64, tbatch *types.TaskBatch) (int64, error)

	AddExcute(ctx context.Context, taskExcute *model.TaskExcute) error

	ExcutePageByOption(ctx context.Context, opt *types.TaskExcuteOption) (*types.Page[*types.TaskExcuteDTO], error)

	CleanLog(ctx context.Context, day int64)

	Dashboard(ctx context.Context) *types.Dashboard
}

func NewService

func NewService() TaskService

Jump to

Keyboard shortcuts

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