schedule

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const JoinDefault = 15

JoinDefault is the largest gap that joins two windows when no level sets it.

View Source
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 JoinGap

func JoinGap(minutes int) string

JoinGap is "up to 15 min apart", or "never" for 0.

func JoinText

func JoinText(minutes int) string

JoinText is "join windows up to 15 min apart", or "windows never join" for 0.

func ParseJoinMinutes

func ParseJoinMinutes(s string) (*int, error)

ParseJoinMinutes reads a --join-minutes value: a whole number from 0 to 120, a multiple of 5, or inherit (nil).

func RefusedAsUnknown

func RefusedAsUnknown(message string) bool

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.

func (Join) Line

func (j Join) Line() string

Line is "join windows up to 15 min apart (organization)" or "windows never join (workload)", "" without a value.

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

func (w Window) FarReach() bool

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.

func (Window) Plain

func (w Window) Plain() bool

Plain is a window with only weekly days and times, as there were before recurrences.

func (Window) Text

func (w Window) Text() string

Text is the window's recurrence in words, without its kind and wake mode: "Every 2 weeks on Mon, Thu, 20:00–07:00 next day, from 2027-01-04, no end date", "Monthly on day 15, 08:00–18:00", "Cron 30 8 * * 1-5, 10 h 30 min".

Jump to

Keyboard shortcuts

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