Documentation ¶
Index ¶
- func StopScheduler(s *Scheduler) error
- type Cron
- type ErrJobRunning
- type ErrJobTimeout
- type ErrPastStartingDeadline
- type History
- type Job
- func (j *Job) AllowConccurentRuns() bool
- func (j *Job) History() []*History
- func (j *Job) ID() string
- func (j *Job) NextFor(t time.Duration) []time.Time
- func (j *Job) NextRun() time.Time
- func (j *Job) Schedule() string
- func (j *Job) StartingDeadline() time.Duration
- func (j *Job) Timeout() time.Duration
- type JobConfig
- type Scheduler
- type SchedulerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StopScheduler ¶
Types ¶
type ErrJobRunning ¶
type ErrJobRunning struct{}
func (ErrJobRunning) Error ¶
func (e ErrJobRunning) Error() string
type ErrJobTimeout ¶
type ErrJobTimeout struct{}
func (ErrJobTimeout) Error ¶
func (e ErrJobTimeout) Error() string
type ErrPastStartingDeadline ¶
type ErrPastStartingDeadline struct{}
func (ErrPastStartingDeadline) Error ¶
func (e ErrPastStartingDeadline) Error() string
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
func (*Job) AllowConccurentRuns ¶
func (*Job) StartingDeadline ¶
type JobConfig ¶
type JobConfig struct { // ID is the unique identifier of the job. ID string // Schedule is the cron schedule that determines when the job will run. Schedule string // Timeout is the amount of time each instance of the job is allowed to // run before it is killed. Timeout time.Duration // StartingDeadline is the maximum time the job can be delayed. If the // job is delayed more than this, it will be skipped. StartingDeadline time.Duration // AllowConccurentRuns determines whether the next job will start // if it is currently running. AllowConccurentRuns bool // This function will be run when the job is executed. Func func(context.Context) error }
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func StartNewScheduler ¶
func StartNewScheduler(cfg *SchedulerConfig) *Scheduler
type SchedulerConfig ¶
func DefaultSchedulerConfig ¶
func DefaultSchedulerConfig() *SchedulerConfig
Source Files ¶
Click to show internal directories.
Click to hide internal directories.