cron

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseNextTime

func ParseNextTime(cronLine string) (nextTime time.Time, err error)

Types

type CronJobTable added in v0.0.26

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

func New

func New() *CronJobTable

func (*CronJobTable) Add added in v0.0.26

func (c *CronJobTable) Add(cronLine string, fn func()) (remove func(), err error)

func (*CronJobTable) Run added in v0.0.26

func (c *CronJobTable) Run()

type Expression

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

func Parse

func Parse(cronLine string) (*Expression, error)

func (*Expression) Next

func (expr *Expression) Next(fromTime time.Time) time.Time

Next returns the closest time instant immediately following `fromTime` which matches the cron expression `expr`

func (*Expression) NextN

func (expr *Expression) NextN(fromTime time.Time, n uint) []time.Time

NextN returns a slice of `n` closest time instants immediately following `fromTime` which match the cron expression `expr`

type Job

type Job struct {
	NextTime time.Time
	// contains filtered or unexported fields
}

Job cron job

Jump to

Keyboard shortcuts

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