Documentation
¶
Overview ¶
Package plan turns recovery objectives into backup settings (ADR-0223): Derive maps them to keys, Apply splices the keys into a file's bytes, CheckConfig runs the daemon's loader on the result and CheckRTO bounds the recovery time. It holds no rule of the daemon's own; cmd/funcdctl wires the flags and the files.
Index ¶
- func CheckConfig(path string, merged []byte) ([]config.Finding, error)
- func CheckRTO(o Objectives) (time.Duration, error)
- func Cron(rpo time.Duration) (string, error)
- func Ladder(keep time.Duration) (hourly, daily, weekly int)
- func RTOBound(size, speed int64) time.Duration
- type Change
- type Component
- type Objectives
- type RTOError
- type Setting
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckConfig ¶
CheckConfig runs the daemon's loader on merged (Decision 3): config.Parse with funcdctl's FUNCD_* environment, its error returned unchanged; then the warnings of CheckBackup and CheckBlob, in that order.
func CheckRTO ¶
func CheckRTO(o Objectives) (time.Duration, error)
CheckRTO is (0, nil) without an RTO, else the bound and, when the RTO is below it, an *RTOError.
func Cron ¶
Cron is the largest period P ≤ rpo ÷ 2 that divides the hour or the day, as a cron expression (ADR-0211 grammar): every P minutes, every P hours, or daily at the 24 h cap. rpo ÷ 2 under a minute is fault.Invalid naming --rpo.
Types ¶
type Change ¶
type Change struct{ Key, Old, New string }
Change is one key Apply edited; Old "" ⇒ the key was absent.
func Apply ¶
Apply sets each of s in doc (Decision 4), every other byte kept: a present scalar's text is replaced in place, a missing key (or parent) is inserted after its parent mapping's last line at the indentation of that mapping's first child (top level: at the end of the document, before the next document marker). kind "" ⇒ doc is a config file of at most one document; else the key is set in the one document of that kind. A key under an alias, an anchor, a block scalar or a flow collection, or a config file of several documents, is fault.Invalid naming the key. A key already at its value is no Change.
type Component ¶
type Component string
Component is what a plan sets: the platform backup, the KV export or the blob mirror keys of funcdconfig.yaml, or a BackupSchedule.
type Objectives ¶
Objectives are the operator's targets; a zero field was not given (Decision 1). Size and Speed are bytes and bytes per second.
type RTOError ¶
RTOError is an RTO below the download time (Decision 5): the settings were accepted, nothing is printed or written.