Documentation
¶
Index ¶
- func CreateDefaultParser() cron.Parser
- func NewCronJob(oneTime bool, expression Expression, wait time.Duration, action run.Runnable) run.Runnable
- func NewCronJobWithOptions(oneTime bool, expression Expression, wait time.Duration, action run.Runnable, ...) run.Runnable
- func NewExpressionCron(expression Expression, action run.Runnable) run.Runnable
- func NewExpressionCronWithOptions(expression Expression, action run.Runnable, options CronJobOptions) run.Runnable
- func NewIntervalCron(wait time.Duration, action run.Runnable) run.Runnable
- func NewIntervalCronWithOptions(wait time.Duration, action run.Runnable, options CronJobOptions) run.Runnable
- func NewOneTimeCron(action run.Runnable) run.Runnable
- func NewOneTimeCronWithOptions(action run.Runnable, options CronJobOptions) run.Runnable
- func NewWaitCron(wait time.Duration, action run.Runnable) run.Runnable
- func WrapWithMetrics(name string, fn run.Runnable) run.Runnable
- func WrapWithOptions(action run.Runnable, options CronJobOptions) run.Runnable
- func WrapWithTimeout(name string, timeout time.Duration, fn run.Runnable) run.Runnable
- type Cron
- type CronJobOptions
- type Expression
- type Metrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultParser ¶ added in v1.2.0
func NewCronJob ¶
func NewCronJobWithOptions ¶ added in v1.4.0
func NewCronJobWithOptions( oneTime bool, expression Expression, wait time.Duration, action run.Runnable, options CronJobOptions, ) run.Runnable
func NewExpressionCron ¶
func NewExpressionCron( expression Expression, action run.Runnable, ) run.Runnable
func NewExpressionCronWithOptions ¶ added in v1.5.0
func NewExpressionCronWithOptions( expression Expression, action run.Runnable, options CronJobOptions, ) run.Runnable
func NewIntervalCron ¶ added in v1.3.1
func NewIntervalCronWithOptions ¶ added in v1.5.0
func NewOneTimeCronWithOptions ¶ added in v1.5.0
func NewOneTimeCronWithOptions( action run.Runnable, options CronJobOptions, ) run.Runnable
func NewWaitCron ¶
NewWaitCron Deprecated: use NewIntervalCron instead
func WrapWithMetrics ¶ added in v1.4.0
func WrapWithOptions ¶ added in v1.5.0
func WrapWithOptions(action run.Runnable, options CronJobOptions) run.Runnable
WrapWithOptions applies all configured wrappers to an action based on the provided options. Wrappers are applied in this order (innermost to outermost): 1. Timeout wrapper (if timeout > 0) 2. Metrics wrapper (if enabled) 3. Parallel skip wrapper (if enabled)
Types ¶
type CronJobOptions ¶ added in v1.4.0
type CronJobOptions struct {
Name string
EnableMetrics bool
Timeout libtime.Duration
ParallelSkip bool
}
func DefaultCronJobOptions ¶ added in v1.4.0
func DefaultCronJobOptions() CronJobOptions
type Expression ¶ added in v1.2.0
type Expression string
Expression of the cron cron.Second | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor every second: * * * * * ? every minute 0 * * * * ? every 15 minute 0 */15 * * * ? every hour: 0 0 * * * ? every hour on sunday: 0 0 * * * 0
func (Expression) Bytes ¶ added in v1.2.0
func (e Expression) Bytes() []byte
func (Expression) Ptr ¶ added in v1.2.0
func (e Expression) Ptr() *Expression
func (Expression) String ¶ added in v1.2.0
func (e Expression) String() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.