Documentation ¶
Index ¶
- func AddJob(isEnable bool, name, caption string, ver int, cron string, job JobFunc, ...)
- func GetClient() *clientVO
- func Kill(TaskId int64)
- func NewClient()
- type ClientJob
- type Job
- type JobContext
- func (receiver *JobContext) Critical(contents ...any)
- func (receiver *JobContext) Criticalf(format string, a ...any)
- func (receiver *JobContext) Debug(contents ...any)
- func (receiver *JobContext) Debugf(format string, a ...any)
- func (receiver *JobContext) Error(contents ...any)
- func (receiver *JobContext) Errorf(format string, a ...any) error
- func (receiver *JobContext) Info(contents ...any)
- func (receiver *JobContext) Infof(format string, a ...any)
- func (receiver *JobContext) SetNextAt(t time.Time)
- func (receiver *JobContext) SetProgress(progress int)
- func (receiver *JobContext) Trace(content ...any)
- func (receiver *JobContext) Tracef(format string, a ...any)
- func (receiver *JobContext) Warning(contents ...any)
- func (receiver *JobContext) Warningf(format string, a ...any)
- type JobFunc
- type Module
- type Option
- type RegistryResponse
- type ResourceVO
- type TaskEO
- type TaskReportDTO
- type TaskStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientJob ¶
type ClientJob struct { Name string // 任务名称 Ver int // 任务版本 Caption string // 任务标题 Cron string // 任务执行表达式 StartAt int64 // 任务开始时间(时间戳秒) IsEnable bool // 任务是否启用 Data collections.Dictionary[string, string] // 第一次注册时使用 // contains filtered or unexported fields }
type JobContext ¶
type JobContext struct { Id int64 // 主键 TaskGroupId int64 // 任务组ID Ver int // 任务版本 Name string // 实现Job的特性名称(客户端识别哪个实现类) Data collections.Dictionary[string, string] // 数据 StartAt time.Time // 任务开始时间 // contains filtered or unexported fields }
JobContext 任务在运行时,更新状态
func (*JobContext) Critical ¶ added in v0.8.0
func (receiver *JobContext) Critical(contents ...any)
Critical 打印Critical日志
func (*JobContext) Criticalf ¶ added in v0.8.0
func (receiver *JobContext) Criticalf(format string, a ...any)
Criticalf 打印Critical日志
func (*JobContext) Debug ¶ added in v0.8.0
func (receiver *JobContext) Debug(contents ...any)
Debug 打印Debug日志
func (*JobContext) Debugf ¶ added in v0.8.0
func (receiver *JobContext) Debugf(format string, a ...any)
Debugf 打印Debug日志
func (*JobContext) Error ¶ added in v0.8.0
func (receiver *JobContext) Error(contents ...any)
Error 打印Error日志
func (*JobContext) Errorf ¶ added in v0.8.0
func (receiver *JobContext) Errorf(format string, a ...any) error
Errorf 打印Error日志
func (*JobContext) Info ¶ added in v0.8.0
func (receiver *JobContext) Info(contents ...any)
Info 打印Info日志
func (*JobContext) Infof ¶ added in v0.8.0
func (receiver *JobContext) Infof(format string, a ...any)
Infof 打印Info日志
func (*JobContext) SetNextAt ¶
func (receiver *JobContext) SetNextAt(t time.Time)
SetNextAt 设置下次运行时间
func (*JobContext) SetProgress ¶
func (receiver *JobContext) SetProgress(progress int)
SetProgress 设置任务进度
func (*JobContext) Trace ¶ added in v0.8.0
func (receiver *JobContext) Trace(content ...any)
Trace 打印Trace日志
func (*JobContext) Tracef ¶ added in v0.8.0
func (receiver *JobContext) Tracef(format string, a ...any)
Tracef 打印Trace日志
func (*JobContext) Warning ¶ added in v0.8.0
func (receiver *JobContext) Warning(contents ...any)
Warning 打印Warning日志
func (*JobContext) Warningf ¶ added in v0.8.0
func (receiver *JobContext) Warningf(format string, a ...any)
Warningf 打印Warning日志
type Module ¶
type Module struct { }
func (Module) DependsModule ¶
func (module Module) DependsModule() []modules.FarseerModule
func (Module) PostInitialize ¶
func (module Module) PostInitialize()
func (Module) PreInitialize ¶
func (module Module) PreInitialize()
type Option ¶ added in v0.9.0
type Option struct { StartAt int64 // 任务开始时间(时间戳秒) Data collections.Dictionary[string, string] // 第一次注册时使用 }
type RegistryResponse ¶ added in v0.9.0
type ResourceVO ¶
type ResourceVO struct { QueueCount int // 排队中的任务数量 WorkCount int // 正在处理的任务数量 CpuUsage float64 // CPU百分比 MemoryUsage float64 // 内存百分比 AllowSchedule bool // 是否允许调度 }
ResourceVO 客户端资源情况
type TaskEO ¶
type TaskEO struct { Id int64 // 主键 Caption string // 任务组标题 TaskGroupId int64 // 任务组ID Name string // 实现Job的特性名称(客户端识别哪个实现类) StartAt time.Time // 开始时间 Data collections.Dictionary[string, string] // 本次执行任务时的Data数据 }
TaskEO 任务记录
type TaskReportDTO ¶
type TaskReportDTO struct { Id int64 // 主键 TaskGroupId int64 // 任务组ID Ver int // 任务版本 Name string // 实现Job的特性名称(客户端识别哪个实现类) Data collections.Dictionary[string, string] // 数据 NextTimespan int64 // 下次执行时间 Progress int // 当前进度 Status TaskStatus // 执行状态 RunSpeed int64 // 执行速度 }
type TaskStatus ¶
type TaskStatus int
const ( None TaskStatus = iota // 未开始 Scheduling // 调度中 ScheduleFail // 调度失败 Working // 执行中 Fail // 成功 Success // 完成 )
func (TaskStatus) String ¶
func (receiver TaskStatus) String() string
Click to show internal directories.
Click to hide internal directories.