Documentation
¶
Overview ¶
Package backup is the backup role: a scheduled export of the installation into an encrypted archive (docs/decisions/0071, decision 9), as a process of its own. It has no loop and no listener. `sluis backup run` is the Kubernetes CronJob's command and the operator's; on Lambda the function takes the schedule's {"kind":"backup"} event (internal/lambdaapp).
The same zip is the restore role (`backup.role: restore`, or `sluis restore` on the command line): one restore at a time, asynchronous, with every module under maintenance while it writes (internal/backup/restorejob).
Index ¶
- Constants
- type Module
- func (Module) Name() string
- func (m Module) Open(ctx context.Context, file string) (*app.App, *slog.Logger, func(), error)
- func (m Module) OpenRole(ctx context.Context, file, role string) (*app.App, *slog.Logger, func(), error)
- func (m Module) Run(ctx context.Context, file string) error
- func (m Module) Tick(ctx context.Context, file, target string, _ bool) error
Constants ¶
const ( // TargetRun writes a backup. TargetRun = "run" // TargetResume continued a paused backup of format 1; it answers idle. TargetResume = "resume" // TargetPrune applies the retention rule. TargetPrune = "prune" )
The targets of a tick.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
Module is the backup role. Log receives the process's log lines; os.Stderr when nil, so that stdout stays what a command prints.
func (Module) Open ¶
Open assembles the module from file. The returned function releases it and flushes the telemetry.
func (Module) OpenRole ¶
func (m Module) OpenRole(ctx context.Context, file, role string) (*app.App, *slog.Logger, func(), error)
OpenRole is Module.Open acting as role (config.BackupRoleBackup or config.BackupRoleRestore) whatever `backup.role` says; empty keeps the document's. It is how `sluis restore` selects the restore function of the same zip.
func (Module) Run ¶
Run implements module.Module: one backup, then it returns. A scheduler calls it again; there is nothing to serve.
func (Module) Tick ¶
Tick implements module.Module: the target is TargetRun, TargetResume or TargetPrune. The leases are in the State all runners share, so unsafeLocal changes nothing.