cron

package
v0.396.7 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CronExpression

type CronExpression struct {
	Minutes    string
	Hours      string
	DayOfMonth string
	Month      string
	DayOfWeek  string
}

func Parse

func Parse(src string) (*CronExpression, error)

func (*CronExpression) String

func (c *CronExpression) String() string

type CronFieldConfig

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

type Error

type Error struct {
	Message string
	Token   *Token
}

func ToError

func ToError(err error) (Error, bool)

func (Error) Error

func (e Error) Error() string

type Token

type Token struct {
	Value string
	Start int
	End   int
}

type Tokens

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

func (*Tokens) List

func (t *Tokens) List() []*Token

List starts at the next token and will keep consuming tokens while they are in a list. A list is separated by commas and 'and'. As an example both 'a,b,c' and 'a, b, and c' would result in the list ['a', 'b', 'c'].

func (*Tokens) Match

func (t *Tokens) Match(expected ...string) (*Token, error)

Match is like like MatchOrNil but will return an error if the returned token is nil

func (*Tokens) MatchOrNil

func (t *Tokens) MatchOrNil(expected ...string) (*Token, error)

MatchOrNil is like Next() but checks that the next token (if it exists) matches one of the expected values

func (*Tokens) Next

func (t *Tokens) Next() *Token

Next returns the next token or nil and advances the current token

func (*Tokens) Peek

func (t *Tokens) Peek() *Token

Peek returns the next token or nil but does not advance the current token

Jump to

Keyboard shortcuts

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