Documentation ¶
Index ¶
Constants ¶
View Source
const ErrStorage = errors.Sentinel("storage error")
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobsRunning ¶
type SelectNextJob ¶
type SelectNextJob func(jr JobsRunning, jtr JobsToRun) (*jw.Job, error)
type State ¶
type State struct { Jobs struct { Todo int `json:"todo"` Pending int `json:"pending"` Running int `json:"running"` Succeeded int `json:"succeeded"` Failed int `json:"failed"` Total int `json:"total"` } Workflows struct { Running int `json:"running"` Succeeded int `json:"succeeded"` Failed int `json:"failed"` Total int `json:"total"` } }
type Storage ¶
type Storage interface { ValidateJob(job *jw.Job) error InsertJob(job *jw.Job) (bool, error) UpdateJob(job *jw.Job) error NotifyJob(id string, data interface{}) error SetJobPriority(id string, priority jw.Priority) error SetJobRunAfter(id string, duration time.Duration) error NextJob(namespace string, fn SelectNextJob) (*jw.Job, error) ValidateWorkflow(wf *jw.Workflow) error InsertWorkflow(wf *jw.Workflow, job *jw.Job) error Workflow(id string, mustExist bool) (*jw.Workflow, error) UpdateWorkflow(wf *jw.Workflow, job, nextJob *jw.Job) error SetWorkflowPriority(id string, priority jw.Priority) error Clean() error State() (*State, error) Close() error }
Click to show internal directories.
Click to hide internal directories.