cron

package
v2.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock added in v2.2.2

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

Clock give time

func (*Clock) Now added in v2.2.2

func (c *Clock) Now() time.Time

Now return current time

type Cron

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

Cron definition

func New added in v2.2.2

func New() *Cron

New create new cron

func (*Cron) At

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

At set hour of run in format HH:MM

func (*Cron) Clock added in v2.2.2

func (c *Cron) Clock(clock *Clock) *Cron

Clock set clock that give current time, mostly for testing purpose

func (*Cron) Days

func (c *Cron) Days() *Cron

Days set recurence to every day

func (*Cron) Each

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

Each set interval of each run

func (*Cron) Friday

func (c *Cron) Friday() *Cron

Friday set recurence to every Friday

func (*Cron) In added in v2.2.1

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

In set timezone

func (*Cron) MaxRetry

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

MaxRetry set maximum retry count

func (*Cron) Monday

func (c *Cron) Monday() *Cron

Monday set recurence to every Monday

func (*Cron) Now added in v2.2.3

func (c *Cron) Now() *Cron

Now run cron now

func (*Cron) Retry

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

Retry set interval retry if action failed

func (*Cron) Saturday

func (c *Cron) Saturday() *Cron

Saturday set recurence to every Saturday

func (*Cron) Start

func (c *Cron) Start(action func(time.Time) error, onError func(error))

Start cron

func (*Cron) Stop

func (c *Cron) Stop()

Stop cron

func (*Cron) String

func (c *Cron) String() string

func (*Cron) Sunday

func (c *Cron) Sunday() *Cron

Sunday set recurence to every Sunday

func (*Cron) Thursday

func (c *Cron) Thursday() *Cron

Thursday set recurence to every Thursday

func (*Cron) Tuesday

func (c *Cron) Tuesday() *Cron

Tuesday set recurence to every Tuesday

func (*Cron) Wednesday

func (c *Cron) Wednesday() *Cron

Wednesday set recurence to every Wednesday

func (*Cron) Weekdays

func (c *Cron) Weekdays() *Cron

Weekdays set 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