Documentation
¶
Index ¶
Constants ¶
View Source
const ( MainCategory = "main" RegSchedulerCategory = "regSchduler" RunJobCategory = "runJob" HttpJobCategory = "httpJob" )
* 定义日志目录类型
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpServer ¶
type RedisConf ¶
type RedisConf struct { Addr string `toml:"addr"` Password string `toml:"password"` DB int `toml:"db"` }
redis设置
type RunTaskResult ¶
type Task ¶
type Task struct { TaskType int `toml:"taskType"` //任务类型: 1-CommandLine ,2- Http Name string `toml:"name"` //任务名称,不唯一 Instances int `toml:"instances"` // 执行时设定的并发实例,默认配置 1 Exclusive bool `toml:"exclusive"` // 任务执行期间是否允许排他,即本次计划未完成,下次时间满足也必须等待或抛弃 RunEnv string `toml:"runEnv"` //当且命令行模式,这里就是/usr/bin/php HttpMethod string `toml:"httpMethod"` //支持http的方法, POST OR GET Path string `toml:"path"` //执行路径 Args []string `toml:"args"` //参数列表 Cron string `toml:"cron"` //执行时间计划满足Unix时间要求 Wg sync.WaitGroup //当前任务计划执行的并发控制,当所有实例结束计划任务才能退出 }
Task任务节点
type TaskLocker ¶
type TaskLocker struct { LockerType string `toml:"lockerType"` LockerWait bool `toml:"lockerWait"` }
locker设置
type TomlConfig ¶
type TomlConfig struct { System Sys `toml:"system"` HttpServer HttpServer `toml:"httpServer"` Locker TaskLocker `toml:"locker"` Redis RedisConf `toml:"redis"` Tasks map[string]Task `toml:"tasks"` //任务节点key为任务唯一标识,value为任务内容 Authorize Authorize `toml:"authorize"` //授权节点 }
toml文件的主节点
Click to show internal directories.
Click to hide internal directories.