Documentation ¶
Index ¶
- func InitConfig(filename string) error
- func InitJobMgr() error
- func InitLogSink() error
- func InitRegister() error
- func InitScheduler()
- type Config
- type JobLock
- type JobMgr
- type LogSink
- type Register
- type Scheduler
- func (scheduler *Scheduler) ExecuteJob(info *common.JobExecuteInfo)
- func (scheduler *Scheduler) PushJobEvent(jobEvent *common.JobEvent)
- func (scheduler *Scheduler) PushJobResult(jobResult *common.JobExecuteResult)
- func (scheduler *Scheduler) TrySchedule() time.Duration
- func (scheduler *Scheduler) TryStartJob(jobPlan *common.JobSchedulePlan)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogSink ¶
func InitLogSink() error
func InitRegister ¶
func InitRegister() error
Types ¶
type Config ¶
type Config struct { EtcdEndpoints []string `json:"etcdEndpoints"` EtcdDialTimeout int `json:"etcdDialTimeout"` MongodbUri string `json:"mongodbUri"` MongodbConnectTimeout int `json:"mongodbConnectTimeout"` JobLogBatchSize int `json:"jobLogBatchSize"` JobLogCommitTimeout int `json"jobLogCommitTimeout"` }
程序配置
var ( // 单例 G_config *Config )
type JobLock ¶
type JobLock struct {
// contains filtered or unexported fields
}
分布式锁(TXN事务)
func InitJobLock ¶
初始化一把锁
type JobMgr ¶
type JobMgr struct {
// contains filtered or unexported fields
}
任务管理器
var G_jobMgr *JobMgr
type LogSink ¶
type LogSink struct {
// contains filtered or unexported fields
}
mongodb存储日志
var G_logSink *LogSink
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
注册节点到etcd: /cron/workers/IP地址
var G_register *Register
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
任务调度
var (
G_scheduler *Scheduler
)
func (*Scheduler) ExecuteJob ¶
func (scheduler *Scheduler) ExecuteJob(info *common.JobExecuteInfo)
func (*Scheduler) PushJobEvent ¶
推送任务变化事件
func (*Scheduler) PushJobResult ¶
func (scheduler *Scheduler) PushJobResult(jobResult *common.JobExecuteResult)
回传任务执行结果
func (*Scheduler) TryStartJob ¶
func (scheduler *Scheduler) TryStartJob(jobPlan *common.JobSchedulePlan)
尝试执行任务
Source Files ¶
Click to show internal directories.
Click to hide internal directories.