Documentation ¶
Index ¶
- Constants
- Variables
- func At(dt time.Time, job *Job, buildWrapper BuildWrapperFunc) cron.EntryID
- func BuildWrapperDefault(job *Job) cron.Job
- func Debounced(dur time.Duration, job *Job, buildWrapper BuildWrapperFunc) cron.EntryID
- func Every(duration time.Duration, job *Job, buildWrapper BuildWrapperFunc) cron.EntryID
- func NTimesEvery(times int, duration time.Duration, job *Job, buildWrapper BuildWrapperFunc) cron.EntryID
- func Now() time.Time
- func OnJobChanged(fn JobChangedFunc)
- func OnceNow(job *Job, buildWrapper BuildWrapperFunc) cron.EntryID
- func Schedule(spec string, job *Job, buildWrapper BuildWrapperFunc) (cron.EntryID, error)
- func Start(ctx context.Context, opts ...Option)
- func Stop()
- type BuildWrapperFunc
- type Job
- func (j *Job) Name() string
- func (j *Job) Next() time.Time
- func (j *Job) Prev() time.Time
- func (j *Job) Result() error
- func (j *Job) Run()
- func (j *Job) RunEnd() time.Time
- func (j *Job) RunStart() time.Time
- func (j *Job) Runner() JobRunner
- func (j *Job) State() JobState
- func (j *Job) String() string
- func (j *Job) Type() JobType
- type JobChangedFunc
- type JobRunner
- type JobState
- type JobType
- type Option
- type Options
Constants ¶
View Source
const (
InvalidEntryID = -1
)
Variables ¶
View Source
var DefaultOptions = Options{ StateUpdateDuration: 15 * time.Second, }
Functions ¶
func At ¶
func At(dt time.Time, job *Job, buildWrapper BuildWrapperFunc) cron.EntryID
Run the given job at a fixed time.
func BuildWrapperDefault ¶
func BuildWrapperDefault(job *Job) cron.Job
func Debounced ¶
func Debounced(dur time.Duration, job *Job, buildWrapper BuildWrapperFunc) cron.EntryID
Run the given job debounced. Consecutive calls on a job with the same name will defer the execution time by given duration.
func Every ¶
func Every(duration time.Duration, job *Job, buildWrapper BuildWrapperFunc) cron.EntryID
Run the given job at a fixed interval. The interval provided is the time between the job ending and the job being run again. The time that the job takes to run is not included in the interval.
func NTimesEvery ¶
func NTimesEvery(times int, duration time.Duration, job *Job, buildWrapper BuildWrapperFunc) cron.EntryID
Run the given job N times at a fixed interval.
func OnJobChanged ¶
func OnJobChanged(fn JobChangedFunc)
With OnJobChanged you define the state update callback
func OnceNow ¶
func OnceNow(job *Job, buildWrapper BuildWrapperFunc) cron.EntryID
Run the given job right now.
Types ¶
type BuildWrapperFunc ¶
type BuildWrapperFunc func(*Job) cron.Job
type JobChangedFunc ¶
type JobChangedFunc func(*Job)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.