Documentation
¶
Overview ¶
Package schedule reads a window of a workload's schedule (the router's lambda/src/lib/schedule.mjs), for `dormeto aws workloads schedule` and `dormeto gcp workloads schedule`: a recurrence in the dashboard's words. The router checks a schedule; nothing here does.
Index ¶
Constants ¶
const JoinDefault = 15
JoinDefault is the largest gap that joins two windows when no level sets it.
const RecurrenceRouter = "0.36.0"
RecurrenceRouter is the first router that takes repeat, from, until, a window's exceptions and joinMinutes.
Variables ¶
This section is empty.
Functions ¶
func ParseJoinMinutes ¶
ParseJoinMinutes reads a --join-minutes value: a whole number from 0 to 120, a multiple of 5, or inherit (nil).
func RefusedAsUnknown ¶
RefusedAsUnknown says a router's refusal is a router older than RecurrenceRouter's: it names repeat, from, until, a window's exceptions or joinMinutes as unknown. A router that has them only says that of a field inside repeat.
Types ¶
type Join ¶
type Join struct {
JoinMinutes json.RawMessage `json:"joinMinutes,omitempty"`
JoinFrom json.RawMessage `json:"joinFrom,omitempty"`
JoinInherited json.RawMessage `json:"joinInherited,omitempty"`
}
Join is what a router's status and schedule answers add beside the schedule: the value in force, its level and what removing the workload's own would give. Raw, so it goes through --json as answered, 0 included, and an older router's answer adds nothing.
type Window ¶
type Window struct {
Kind string `json:"kind"`
Days []string `json:"days"`
Start string `json:"start"`
End string `json:"end"`
Repeat json.RawMessage `json:"repeat"`
From string `json:"from"`
Until string `json:"until"`
Wake string `json:"wake"`
Exceptions []string `json:"exceptions"`
}
Window is a window as the router stores it. Repeat stays raw until it is read: a stored one that does not read has no occurrence and raises no error, so it cannot fail the decoding of the schedule around it. null on a field is its absence. Exceptions are the window's own dates without it (router 0.36.0); the schedule's skip every window.
func (Window) FarReach ¶
FarReach is a window that takes the router's next events as far as 400 days: a repeat or a from; an until alone does not.