Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScheduleItem ¶
type ScheduleItem struct { TaskID int64 // used as the param in the hook SrcResource *model.Resource DstResource *model.Resource }
ScheduleItem is an item that can be scheduled
type ScheduleResult ¶
ScheduleResult is the result of the schedule for one item
type Scheduler ¶
type Scheduler interface { // Preprocess the resources and returns the item list that can be scheduled Preprocess([]*model.Resource, []*model.Resource) ([]*ScheduleItem, error) // Schedule the items. If got error when scheduling one of the items, // the error should be put in the corresponding ScheduleResult and the // returning error of this function should be nil Schedule([]*ScheduleItem) ([]*ScheduleResult, error) // Stop the job specified by ID Stop(id string) error }
Scheduler schedules
func NewScheduler ¶
NewScheduler returns an instance of Scheduler
Click to show internal directories.
Click to hide internal directories.