backup

package
v1.76.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 10 Imported by: 0

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

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

type Module struct{ Log io.Writer }

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) Name

func (Module) Name() string

Name implements module.Module.

func (Module) Open

func (m Module) Open(ctx context.Context, file string) (*app.App, *slog.Logger, func(), error)

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

func (m Module) Run(ctx context.Context, file string) error

Run implements module.Module: one backup, then it returns. A scheduler calls it again; there is nothing to serve.

func (Module) Tick

func (m Module) Tick(ctx context.Context, file, target string, _ bool) error

Tick implements module.Module: the target is TargetRun, TargetResume or TargetPrune. The leases are in the State all runners share, so unsafeLocal changes nothing.

Jump to

Keyboard shortcuts

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