Documentation ¶
Index ¶
Constants ¶
View Source
const ( // StatusAdd add task flag StatusAdd = 1 // StatusDel del task flag StatusDel = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler struct { WaitGroup util.WaitGroupWrapper Tasks Tasks Raft *raft.Raft // contains filtered or unexported fields }
Scheduler is task scheduler struct
func NewScheduler ¶
NewScheduler returns scheduler instance
type Task ¶
type Task struct { Name string `json:"name"` Cmd string `json:"cmd"` CronLine string `json:"cron_line"` PlanExecTime time.Time `json:"-"` CronExpression *cronexpr.Expression `json:"-"` Status int `json:"-"` NodeID string `json:"-"` IP string `json:"-"` ActualStartTime time.Time `json:"-"` ActualEndTime time.Time `json:"-"` Result []byte `json:"-"` }
Task struct {"name":"task1", "cmd":"echo hello;", "cron_line":"*/5 * * * * * *"}`
Click to show internal directories.
Click to hide internal directories.