client

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ITaskClient

type ITaskClient interface {
	CreateTask(ctx context.Context, user, group string, taskTyp uint32, taskCtx string, autoRun bool) (uint32, error)
	GetTask(ctx context.Context, taskID uint32) (*model.AsyncTask, error)
	GetTasks(ctx context.Context, user, group string, taskTypes []uint32, status []trans.TaskStatus, offset, limit int32) ([]*model.AsyncTask, error)

	ChangeTaskGroup(ctx context.Context, taskID uint32, group string) error

	SelectOneRun(ctx context.Context, taskTypes []uint32) (*model.AsyncTask, error)
	SelectOneDelete(ctx context.Context, taskTypes []uint32) (*model.AsyncTask, error)

	TransStatus(ctx context.Context, taskID uint32, event trans.TaskEvent) error

	CheckStop(ctx context.Context, taskID uint32) (bool, error)
	UpdateHeartbeat(ctx context.Context, taskID uint32) error
	UpdateContext(ctx context.Context, taskID uint32, taskCtx string) error
	Delete(ctx context.Context, taskID uint32) error

	Clean(ctx context.Context, timeout int) error
}

ITaskClient goroutine safe

func NewClient

func NewClient(db *gorm.DB, cfg config.Config) (ITaskClient, error)

Jump to

Keyboard shortcuts

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