Documentation ¶
Index ¶
- Variables
- func AddJob(isEnable bool, name, caption string, ver int, cronString string, job JobFunc, ...)
- type ClientVO
- 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)
- func (receiver *JobContext) Info(contents ...any)
- func (receiver *JobContext) Infof(format string, a ...any)
- func (receiver *JobContext) Remark(format string, a ...any)
- func (receiver *JobContext) SetNextAt(t time.Time)
- func (receiver *JobContext) SetProgress(progress int)
- func (receiver *JobContext) Trace(contents ...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
Constants ¶
This section is empty.
Variables ¶
View Source
var StandardParser = cron.NewParser(cron.Second | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)
Functions ¶
Types ¶
type ClientVO ¶ added in v0.15.0
type ClientVO 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 // 主键 Name string // 实现Job的特性名称(客户端识别哪个实现类) Ver int // 任务版本 Caption string // 任务标题 Data collections.Dictionary[string, string] // 数据 StartAt time.Time // 任务开始时间 Ctx context.Context // 客户端执行时,需要检查ctx是否被Cancel // 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)
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) Remark ¶ added in v0.14.0
func (receiver *JobContext) Remark(format string, a ...any)
Remark 报告失败原因
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(contents ...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] // 第一次注册时使用 }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.