trans

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskEvent

type TaskEvent int32

TaskEvent 任务事件

const (
	EventUserRun    TaskEvent = 1 // 用户运行任务
	EventUserDelete TaskEvent = 2 // 用户删除任务
	EventUserPause  TaskEvent = 3 // 用户暂停任务
)

用户事件

const (
	EventSysExecute TaskEvent = 4 // 系统执行任务
	EventSysPause   TaskEvent = 6 // 系统暂停任务
)

系统事件

const (
	EventTaskFinished TaskEvent = 7 // 任务结束
	EventTaskFailed   TaskEvent = 8 // 任务失败
)

任务事件

const (
	EventNone TaskEvent = 0
)

type TaskMark

type TaskMark int32

TaskMark 任务标记,任务期望的操作

const (
	TaskMarkNone   TaskMark = 0 // 无标记
	TaskMarkRun    TaskMark = 1 // 标记需要开始
	TaskMarkDelete TaskMark = 2 // 标记需要删除
	TaskMarkPause  TaskMark = 3 // 标记需要暂停
)

type TaskState

type TaskState int32

TaskState 任务状态

const (
	TaskStateInit     TaskState = 0 // 已创建
	TaskStatePending  TaskState = 1 // 排队中
	TaskStateRunning  TaskState = 2 // 运行中
	TaskStateDeleting TaskState = 3 // 删除中
	TaskStatePause    TaskState = 4 // 暂停
	TaskStateFinished TaskState = 5 // 结束
	TaskStateFailed   TaskState = 6 // 失败
)

type TaskStatus

type TaskStatus struct {
	S TaskState
	M TaskMark
}

TaskStatus 任务{状态, 标记}组合

func CheckTransfer

func CheckTransfer(taskStatus TaskStatus, event TaskEvent) (TaskStatus, bool, error)

Jump to

Keyboard shortcuts

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