cron

package
v0.196.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Next

func Next(pattern Pattern, allowCurrentTime bool) (time.Time, error)

Next calculates the next time that matches the pattern after the current time See NextAfter for more details

func NextAfter

func NextAfter(pattern Pattern, origin time.Time, inclusive bool) (time.Time, error)

NextAfter calculcates the next time that matches the pattern after the origin time If inclusive is true, the origin time is considered a valid match All calculations are done in UTC, and the result is returned in UTC

Types

type Component

type Component struct {
	List []Step `parser:"(@@ (',' @@)*)"`
}

func (Component) String

func (c Component) String() string

type Pattern

type Pattern struct {
	Components []Component `parser:"@@*"`
}

func Parse

func Parse(text string) (Pattern, error)

func (Pattern) String

func (p Pattern) String() string

type Step

type Step struct {
	ValueRange ValueRange `parser:"@@"`
	Step       *int       `parser:"('/' @Number)?"`
}

func (*Step) String

func (s *Step) String() string

type ValueRange

type ValueRange struct {
	IsFullRange bool `parser:"(@'*'"`
	Start       *int `parser:"| @Number"`
	End         *int `parser:"('-' @Number)?)"`
}

func (*ValueRange) String

func (r *ValueRange) String() string

Jump to

Keyboard shortcuts

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