local

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package local stores backup bundles on a filesystem path.

The v1 backup destination (R-217). Honest about what it is: a bundle beside the install it backs up does not survive the disk failing, and R-217 says so plainly. It exists because a DR path that only works once a remote destination is configured is a DR path nobody tests, and because "recover from a recent mistake" (R-210) is served perfectly well by local disk.

Retention is Pando's here: a filesystem has no lifecycle rules, so OwnsRetention is false and core prunes (R-211).

Index

Constants

View Source
const Kind = "local"

Kind is the adapter kind.

Variables

This section is empty.

Functions

func Info

func Info() api.KindInfo

Info describes this kind of adapter for the forms that configure one (api.KindInfo, R-261).

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter writes bundles into a directory.

func New

func New() *Adapter

New returns an unconfigured adapter.

func (*Adapter) Capabilities

func (a *Adapter) Capabilities() api.BackupCapabilities

Capabilities: a filesystem expires nothing on its own.

func (*Adapter) Category

func (a *Adapter) Category() api.Category

func (*Adapter) Configure

func (a *Adapter) Configure(_ context.Context, raw json.RawMessage) error

func (*Adapter) Delete

func (a *Adapter) Delete(_ context.Context, name string) error

func (*Adapter) HealthCheck

func (a *Adapter) HealthCheck(_ context.Context) error

HealthCheck writes and removes a probe file.

Not a stat: a directory that exists and is not writable is the failure this needs to catch, and it must be caught before the disaster rather than during it. A read-only mount reports healthy to every check that only looks.

func (*Adapter) Kind

func (a *Adapter) Kind() string

func (*Adapter) List

func (a *Adapter) List(_ context.Context) ([]api.StoredBundle, error)

func (*Adapter) Reader

func (a *Adapter) Reader(_ context.Context, name string) (io.ReadCloser, error)

func (*Adapter) Writer

func (a *Adapter) Writer(_ context.Context, name string) (io.WriteCloser, error)

Writer creates a bundle, written to a temporary name and renamed on Close.

Atomic because a half-written bundle that looks whole is exactly the failure R-215 exists to catch, and catching it at restore time is catching it too late. A crash mid-write leaves a .partial file, which List ignores.

Jump to

Keyboard shortcuts

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