task

package
v4.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager[T tache.Task] interface {
	Add(task T)
	Cancel(id string)
	CancelAll()
	CancelByCondition(condition func(task T) bool)
	GetAll() []T
	GetByID(id string) (T, bool)
	GetByState(state ...tache.State) []T
	GetByCondition(condition func(task T) bool) []T
	Remove(id string)
	RemoveAll()
	RemoveByState(state ...tache.State)
	RemoveByCondition(condition func(task T) bool)
	Retry(id string)
	RetryAllFailed()
}

type TaskExtension

type TaskExtension struct {
	tache.Base
	Creator *model.User

	ApiUrl string
	// contains filtered or unexported fields
}

func (*TaskExtension) ClearEndTime

func (t *TaskExtension) ClearEndTime()

func (*TaskExtension) GetCreator

func (t *TaskExtension) GetCreator() *model.User

func (*TaskExtension) GetEndTime

func (t *TaskExtension) GetEndTime() *time.Time

func (*TaskExtension) GetStartTime

func (t *TaskExtension) GetStartTime() *time.Time

func (*TaskExtension) GetTotalBytes

func (t *TaskExtension) GetTotalBytes() int64

func (*TaskExtension) ReinitCtx

func (t *TaskExtension) ReinitCtx() error

func (*TaskExtension) SetCreator

func (t *TaskExtension) SetCreator(creator *model.User)

func (*TaskExtension) SetCtx

func (t *TaskExtension) SetCtx(ctx context.Context)

func (*TaskExtension) SetEndTime

func (t *TaskExtension) SetEndTime(endTime time.Time)

func (*TaskExtension) SetStartTime

func (t *TaskExtension) SetStartTime(startTime time.Time)

func (*TaskExtension) SetTotalBytes

func (t *TaskExtension) SetTotalBytes(totalBytes int64)

type TaskExtensionInfo

type TaskExtensionInfo interface {
	tache.TaskWithInfo
	GetCreator() *model.User
	GetStartTime() *time.Time
	GetEndTime() *time.Time
	GetTotalBytes() int64
}

Jump to

Keyboard shortcuts

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