async

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMgrAlreadyStop = errors.New("async mgr already stop")
)

Functions

This section is empty.

Types

type Mgr

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

Mgr goroutine safe

func NewMgr

func NewMgr(db *gorm.DB, cfg config.Config) (*Mgr, error)

func (*Mgr) ChangeTaskGroup

func (m *Mgr) ChangeTaskGroup(ctx context.Context, taskID uint32, group string) error

func (*Mgr) CreateTask

func (m *Mgr) CreateTask(ctx context.Context, user, group string, taskTyp uint32, taskCtx string, autoRun bool) (uint32, error)

func (*Mgr) GetTask

func (m *Mgr) GetTask(ctx context.Context, taskID uint32) (*model.AsyncTask, error)

func (*Mgr) GetTasks

func (m *Mgr) GetTasks(ctx context.Context, user, group string, taskTypes []uint32, status []trans.TaskStatus, offset, limit int32) ([]*model.AsyncTask, error)

func (*Mgr) RegisterTask

func (m *Mgr) RegisterTask(taskTyp uint32, newTask async_task.ITaskFunc) error

func (*Mgr) Run

func (m *Mgr) Run(ctx context.Context) error

func (*Mgr) Stop

func (m *Mgr) Stop()

func (*Mgr) UserDelete

func (m *Mgr) UserDelete(ctx context.Context, taskID uint32) error

func (*Mgr) UserPause

func (m *Mgr) UserPause(ctx context.Context, taskID uint32) error

func (*Mgr) UserRun

func (m *Mgr) UserRun(ctx context.Context, taskID uint32) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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