cron

package
v4.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cron

type Cron struct {
	// contains filtered or unexported fields
}

Cron definition

func New

func New() *Cron

New creates new cron

func (*Cron) At

func (c *Cron) At(hour string) *Cron

At sets hour of run in format HH:MM

func (*Cron) Days

func (c *Cron) Days() *Cron

Days sets recurence to every day

func (*Cron) Each

func (c *Cron) Each(interval time.Duration) *Cron

Each sets interval of each run

func (*Cron) Exclusive added in v4.6.0

func (c *Cron) Exclusive(redisApp redis.App, name string, timeout time.Duration) *Cron

Exclusive runs cron in an exclusive manner with a distributed lock on Redis

func (*Cron) Friday

func (c *Cron) Friday() *Cron

Friday sets recurence to every Friday

func (*Cron) In

func (c *Cron) In(tz string) *Cron

In sets timezone

func (*Cron) MaxRetry

func (c *Cron) MaxRetry(maxRetry uint) *Cron

MaxRetry sets maximum retry count

func (*Cron) Monday

func (c *Cron) Monday() *Cron

Monday sets recurence to every Monday

func (*Cron) Now

func (c *Cron) Now() *Cron

Now run cron now

func (*Cron) OnError

func (c *Cron) OnError(onError func(error)) *Cron

OnError defines error handling function

func (*Cron) OnSignal

func (c *Cron) OnSignal(signal os.Signal) *Cron

OnSignal sets signal listened for trigerring cron

func (*Cron) Retry

func (c *Cron) Retry(retryInterval time.Duration) *Cron

Retry sets interval retry if action failed

func (*Cron) Saturday

func (c *Cron) Saturday() *Cron

Saturday sets recurence to every Saturday

func (*Cron) Shutdown

func (c *Cron) Shutdown()

Shutdown cron, do not attempt Start() after

func (*Cron) Start

func (c *Cron) Start(action func(context.Context) error, done <-chan struct{})

Start cron

func (*Cron) String

func (c *Cron) String() string

func (*Cron) Sunday

func (c *Cron) Sunday() *Cron

Sunday sets recurence to every Sunday

func (*Cron) Thursday

func (c *Cron) Thursday() *Cron

Thursday sets recurence to every Thursday

func (*Cron) Tuesday

func (c *Cron) Tuesday() *Cron

Tuesday sets recurence to every Tuesday

func (*Cron) Wednesday

func (c *Cron) Wednesday() *Cron

Wednesday sets recurence to every Wednesday

func (*Cron) Weekdays

func (c *Cron) Weekdays() *Cron

Weekdays sets recurence to every day except sunday and saturday

Jump to

Keyboard shortcuts

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