Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CronScheduler ¶
type CronScheduler struct {
C *cron.Cron
}
CronScheduler implements LifeCycleTimer wrapping a cron.Cron instance.
func (*CronScheduler) Schedule ¶
func (lct *CronScheduler) Schedule(spec interface{}, job func()) (id interface{}, err error)
func (*CronScheduler) Start ¶
func (lct *CronScheduler) Start()
func (*CronScheduler) Stop ¶
func (lct *CronScheduler) Stop()
func (*CronScheduler) Unschedule ¶
func (lct *CronScheduler) Unschedule(id interface{}) error
type Provider ¶
type Provider interface { // Schedule adds a job to the scheduler which is // executed according to the given spec. // // Returns an id of the scheduled job and n error // when the job could not be scheduled. Schedule(spec interface{}, job func()) (id interface{}, err error) // Unschedule removes the given job by its id // from the scheduler so it will not be executed // anymore. Unschedule(id interface{}) error // Start runs the scheduler cycle. Start() // Stop cancels the scheduler cycle. Stop() }
Provider provides a job scheduler which executes given jobs at a specified time or in a given location.
Click to show internal directories.
Click to hide internal directories.