cron

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScheduleSpec

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

func ParseCronSchedule

func ParseCronSchedule(interval string) (*ScheduleSpec, error)

ParseCronSchedule can parse standard cron notation it returns a new crontab schedule representing the given standardSpec (https://en.wikipedia.org/wiki/Cron). It requires 5 entries representing: minute, hour, day of month, month and day of week, in that order. It returns a descriptive error if the spec is not valid.

It accepts

  • Standard crontab specs, e.g. "* * * * ?"
  • Descriptors, e.g. "@midnight", "@every 1h30m"

func (*ScheduleSpec) Next

func (s *ScheduleSpec) Next(t time.Time) time.Time

Next accepts the time and returns the next run time that should be used for execution

func (*ScheduleSpec) Prev

func (s *ScheduleSpec) Prev(currTime time.Time) time.Time

Jump to

Keyboard shortcuts

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