Documentation ¶
Index ¶
- Constants
- type CronJob
- func (j *CronJob) Create(uid uint, params view.CronJob) (err error)
- func (j *CronJob) Delete(id uint) (err error)
- func (j *CronJob) DispatchOnce(id uint, node string) (err error)
- func (j *CronJob) List(params view.ReqQueryJobs) (list []view.CronJobListItem, pagination core.Pagination, err error)
- func (j *CronJob) ListTask(params view.ReqQueryTasks) (list []view.CronTask, pagination view.Pagination, err error)
- func (j *CronJob) StartWatch()
- func (j *CronJob) TaskDetail(id uint) (detail view.CronTaskDetail, err error)
- func (j *CronJob) Update(params view.CronJob) (err error)
- type Dispatcher
- type Job
- type OnceJob
- type ResultWatcher
- type TaskResult
- type Timer
Constants ¶
View Source
const ( EtcdKeyJobPrefix = "/juno/cronjob/job/" // Job下发 EtcdKeyFmtOnceJob = "/juno/cronjob/once/{{hostname}}/{{jobId}}" // 单次任务 EtcdKeyFmtTaskLock = "/juno/cronjob/lock/{{jobId}}//{{taskId}}" // 执行锁 EtcdKeyResultPrefix = "/juno/cronjob/result/" // 执行结果通知 /juno/cronjob/result/{{jobId}}/{{taskId}} EtcdKeyPrefixProc = "/juno/cronjob/proc/" // 当前运行的进程 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CronJob ¶
type CronJob struct {
// contains filtered or unexported fields
}
CronJob ..
func (*CronJob) DispatchOnce ¶
DispatchOnce 下发任务手动执行单次
func (*CronJob) List ¶
func (j *CronJob) List(params view.ReqQueryJobs) (list []view.CronJobListItem, pagination core.Pagination, err error)
List Job 列表
func (*CronJob) ListTask ¶
func (j *CronJob) ListTask(params view.ReqQueryTasks) (list []view.CronTask, pagination view.Pagination, err error)
ListTask 任务列表
func (*CronJob) StartWatch ¶
func (j *CronJob) StartWatch()
func (*CronJob) TaskDetail ¶
func (j *CronJob) TaskDetail(id uint) (detail view.CronTaskDetail, err error)
TaskDetail Task 详情
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
type Job ¶
type Job struct { ID string `json:"id"` Name string `json:"name"` Script string `json:"script"` Timers []Timer `json:"timers"` Enable bool `json:"enable"` // 可手工控制的状态 Timeout uint `json:"timeout"` // 单位时间秒,任务执行时间超时设置,大于 0 时有效 RetryCount uint `json:"retry_count"` RetryInterval uint `json:"retry_interval"` Env string `json:"env"` Zone string `json:"zone"` Nodes []string `json:"nodes"` JobType db.CronJobType `json:"job_type"` }
type ResultWatcher ¶
func (*ResultWatcher) Start ¶
func (r *ResultWatcher) Start()
type TaskResult ¶
Click to show internal directories.
Click to hide internal directories.