Documentation
¶
Overview ¶
Package cronspec is muster's ONE cron grammar: the five-field UTC expression a builtin officer's schedule (internal/officers/builtin) and a scheduled host job (internal/hostjobs, docs/host-jobs.md) both take, so the two cannot disagree about what an expression means. A leaf of the standard library alone, so the host binary (muster-mirror) checks its own jobs file with it without linking the server's stores.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cron ¶
type Cron struct {
// contains filtered or unexported fields
}
Cron is a parsed five-field cron expression — minute hour day-of-month month day-of-week — evaluated in UTC. Each field takes `*`, a number, a range `a-b`, a list `a,b,c` and a step `*/n` or `a-b/n`; day-of-week is 0–6 with 0 (or 7) Sunday. When BOTH day fields are restricted a day matches if EITHER does; a field counts as unrestricted only when it is a bare `*` — so `*/2` restricts (robfig/cron's rule; Vixie cron treats any field starting with `*` as unrestricted). No names (MON, JAN), no `@daily` macros, no seconds: 0118's CHECK already holds an officer schedule's column to five fields, and 0166's a host job's.
func (Cron) Next ¶
Next is the first minute strictly after t (in UTC) that c matches, and false when there is none within cronHorizon.
func (Cron) ShortestInterval ¶
ShortestInterval is the shortest gap between two consecutive fires of c in the eight days after from (0 when it fires at most once there): what a host officer's spawn budget is sized from (officers.SpawnBudgetFor).