Documentation
¶
Overview ¶
Package runner runs the platform backup (ADR-0205): one run at a time, on a cadence anchored on the newest complete ladder generation; a status read from the target's listing; the funcd.backup metrics; and the rpoRisk alert on the newest verified generation. The blob mirror (ADR-0208) and the KV export (ADR-0209) report their runs to Recorder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Target backup.Target
Sealer *envelope.Sealer
Hold interface{ Held() bool }
Times config.BackupTimes
Meter metric.Meter
Logger *slog.Logger
Clock clock.Clock
After func(time.Duration) <-chan time.Time
}
Config builds a Runner. Target nil runs no platform backup (the streams only); Hold nil is never held (ADR-0206); Meter nil records nothing; Clock nil is the system clock; After nil is time.After.
type Inputs ¶
Inputs are the stores a run cuts (ADR-0202) and the generation a restore loaded (ADR-0206), nil at a first start.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner runs the platform backup and keeps its status in memory.
func New ¶
New builds a Runner and registers its instruments; a Target without a Sealer, or with a time not positive, is fault.Invalid.
func (*Runner) Recorder ¶
Recorder returns the report function of a sibling backup stream ("blob", "kv"): a nil error is a success at the call, else a failure; either is counted.
type Status ¶
type Status struct {
Enabled bool `json:"enabled"`
Held bool `json:"held"`
RPORisk bool `json:"rpoRisk"`
Interval v1.Duration `json:"interval"`
RPO v1.Duration `json:"rpo"`
LastFailure *Failure `json:"lastFailure,omitempty"`
LastSuccessTime *v1.Timestamp `json:"lastSuccessTime,omitempty"`
LastVerifiedTime *v1.Timestamp `json:"lastVerifiedTime,omitempty"`
EarliestRestorePoint *v1.Timestamp `json:"earliestRestorePoint,omitempty"`
NextRunTime *v1.Timestamp `json:"nextRunTime,omitempty"`
Streams map[string]Stream `json:"streams,omitempty"`
}
Status is the platform backup's status (Decision 4). Its times come from the target's listing, so they survive a restart; LastFailure and Streams are since the start.