Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConstantSchedule ¶
func Every ¶
func Every(duration time.Duration) ConstantSchedule
Every returns a ConstantSchedule that runs every duration given as parameter.
type CronSchedule ¶
type CronSchedule struct {
Expression *cronexpr.Expression
}
func Cron ¶
func Cron(expression string) CronSchedule
Cron returns a CronSchedule using the cron expression giving as parameter of the function.
type RandomInterval ¶
RandomInterval defines a random interval schedule.
func EveryRandom ¶
func EveryRandom(interval time.Duration, plusOrMinus float64) RandomInterval
EveryRandom takes an interval with an ajustable plus or minus percentage of this interval. The plusOrMinus paramter should be between 0 and 1. It returns a Schedule. For example, EveryRandom(4*time.Second, 0.5) will return a Schedule that can return between 2 and 6 seconds.
func (RandomInterval) RandomRange ¶
func (r RandomInterval) RandomRange() (min, max float64)
Click to show internal directories.
Click to hide internal directories.