Documentation
¶
Index ¶
- type CronJob
- type CronJobState
- type CronPayload
- type CronSchedule
- type CronService
- func (cs *CronService) AddJob(name string, schedule CronSchedule, message string, deliver bool, ...) (*CronJob, error)
- func (cs *CronService) EnableJob(jobID string, enabled bool) *CronJob
- func (cs *CronService) GetJob(jobID string) *CronJob
- func (cs *CronService) ListJobs(includeDisabled bool) []CronJob
- func (cs *CronService) Load() error
- func (cs *CronService) RemoveJob(jobID string) bool
- func (cs *CronService) SetRuntimeOptions(opts RuntimeOptions)
- func (cs *CronService) Start() error
- func (cs *CronService) Status() map[string]interface{}
- func (cs *CronService) Stop()
- func (cs *CronService) UpdateJob(jobID string, in UpdateJobInput) (*CronJob, error)
- type CronStore
- type JobHandler
- type RuntimeOptions
- type UpdateJobInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CronJob ¶
type CronJob struct {
ID string `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Schedule CronSchedule `json:"schedule"`
Payload CronPayload `json:"payload"`
State CronJobState `json:"state"`
CreatedAtMS int64 `json:"createdAtMs"`
UpdatedAtMS int64 `json:"updatedAtMs"`
DeleteAfterRun bool `json:"deleteAfterRun"`
}
type CronJobState ¶
type CronJobState struct {
NextRunAtMS *int64 `json:"nextRunAtMs,omitempty"`
LastRunAtMS *int64 `json:"lastRunAtMs,omitempty"`
LastStatus string `json:"lastStatus,omitempty"`
LastError string `json:"lastError,omitempty"`
LastDurationMS int64 `json:"lastDurationMs,omitempty"`
LastScheduleDelayMS int64 `json:"lastScheduleDelayMs,omitempty"`
TotalRuns int64 `json:"totalRuns,omitempty"`
TotalFailures int64 `json:"totalFailures,omitempty"`
ConsecutiveFailures int64 `json:"consecutiveFailures,omitempty"`
}
type CronPayload ¶
type CronSchedule ¶
type CronService ¶
type CronService struct {
// contains filtered or unexported fields
}
func NewCronService ¶
func NewCronService(storePath string, onJob JobHandler) *CronService
func (*CronService) AddJob ¶
func (cs *CronService) AddJob(name string, schedule CronSchedule, message string, deliver bool, channel, to string) (*CronJob, error)
func (*CronService) EnableJob ¶
func (cs *CronService) EnableJob(jobID string, enabled bool) *CronJob
func (*CronService) GetJob ¶
func (cs *CronService) GetJob(jobID string) *CronJob
func (*CronService) ListJobs ¶
func (cs *CronService) ListJobs(includeDisabled bool) []CronJob
func (*CronService) Load ¶
func (cs *CronService) Load() error
func (*CronService) RemoveJob ¶
func (cs *CronService) RemoveJob(jobID string) bool
func (*CronService) SetRuntimeOptions ¶
func (cs *CronService) SetRuntimeOptions(opts RuntimeOptions)
func (*CronService) Start ¶
func (cs *CronService) Start() error
func (*CronService) Status ¶
func (cs *CronService) Status() map[string]interface{}
func (*CronService) Stop ¶
func (cs *CronService) Stop()
func (*CronService) UpdateJob ¶
func (cs *CronService) UpdateJob(jobID string, in UpdateJobInput) (*CronJob, error)
type JobHandler ¶
type RuntimeOptions ¶
type RuntimeOptions struct {
RunLoopMinSleep time.Duration
RunLoopMaxSleep time.Duration
RetryBackoffBase time.Duration
RetryBackoffMax time.Duration
MaxConsecutiveFailureRetries int64
MaxWorkers int
}
func DefaultRuntimeOptions ¶
func DefaultRuntimeOptions() RuntimeOptions
type UpdateJobInput ¶
Click to show internal directories.
Click to hide internal directories.