Documentation ¶
Overview ¶
@area /api/
该文件由fsctl route命令自动生成,请不要手动修改此文件
Index ¶
- Variables
- func AddJob(isEnable bool, name, caption string, ver int, cronString string, job JobFunc, ...)
- func GetClient() *clientVO
- func Kill(taskId int64)
- func NewClient()
- func RegistryJob()
- 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)
- 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
- type RegistryResponse
- type ResourceVO
- type TaskEO
- type TaskReportDTO
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 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 // 主键 Ver int // 任务版本 Name string // 实现Job的特性名称(客户端识别哪个实现类) 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] // 第一次注册时使用 }
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 // 任务组标题 Name string // 实现Job的特性名称(客户端识别哪个实现类) StartAt time.Time // 开始时间 Data collections.Dictionary[string, string] // 本次执行任务时的Data数据 }
TaskEO 任务记录
type TaskReportDTO ¶
type TaskReportDTO struct { Id int64 // 主键 Ver int // 任务版本 Name string // 实现Job的特性名称(客户端识别哪个实现类) Data collections.Dictionary[string, string] // 数据 NextTimespan int64 // 下次执行时间 Progress int // 当前进度 Status executeStatus.Enum // 执行状态 FailRemark string // 失败原因 ResourceVO }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.