extcron

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParser

func NewParser() cron.ScheduleParser

NewParser creates an ExtParser instance

func Parse

func Parse(spec string) (cron.Schedule, error)

Parse parses a cron schedule. This is a convenience function to not have to instantiate a parser with NewParser for every call.

Types

type ExtParser

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

ExtParser is a parser extending robfig/cron v3 standard parser with several additional descriptors

func (ExtParser) Parse

func (p ExtParser) Parse(spec string) (cron.Schedule, error)

Parse parses a cron schedule specification. It accepts the cron spec with mandatory seconds parameter, descriptors and the custom descriptors "@at <date>", "@manually" and "@minutely".

type SimpleSchedule

type SimpleSchedule struct {
	Date time.Time
}

SimpleSchedule represents a simple non recurring duration.

func At

func At(date time.Time) SimpleSchedule

At just stores the given time for this schedule.

func (SimpleSchedule) Next

func (schedule SimpleSchedule) Next(t time.Time) time.Time

Next conforms to the Schedule interface but this kind of jobs doesn't need to be run more than once, so it doesn't return a new date but the existing one.

Jump to

Keyboard shortcuts

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