cron

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2024 License: BSD-2-Clause Imports: 7 Imported by: 7

README

Cron

Run something over and over again.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefaultParser added in v1.2.0

func CreateDefaultParser() cron.Parser

Types

type Cron

type Cron interface {
	Run(ctx context.Context) error
}

type CronJob

type CronJob interface {
	Run(ctx context.Context) error
}

func NewCronJob

func NewCronJob(
	oneTime bool,
	expression Expression,
	wait time.Duration,
	action run.Runnable,
) CronJob

func NewExpressionCron

func NewExpressionCron(
	expression Expression,
	action run.Runnable,
) CronJob

func NewOneTimeCron

func NewOneTimeCron(
	action run.Runnable,
) CronJob

func NewWaitCron

func NewWaitCron(
	wait time.Duration,
	action run.Runnable,
) CronJob

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

Directories

Path Synopsis
cmd
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL