providers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package providers defines the BackupProvider interface that all backup backends must implement.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupProvider

type BackupProvider interface {
	// Name returns the provider identifier (e.g. "restic").
	Name() string

	// Validate checks that the provider can access the backup
	// repository described by the contract. It does not restore
	// anything.
	Validate(ctx context.Context, source contract.Source) error

	// ListSnapshots returns the available snapshots in the repository.
	ListSnapshots(ctx context.Context, source contract.Source) ([]Snapshot, error)

	// GetSnapshotMetadata returns size and file-count information
	// for a specific snapshot. Not all providers support this.
	GetSnapshotMetadata(ctx context.Context, source contract.Source) (*SnapshotMetadata, error)

	// RestoreArtifact restores the artifact referenced by the
	// contract into the given destination directory. It returns
	// the absolute path to the restored file.
	RestoreArtifact(ctx context.Context, source contract.Source, destination string) (string, error)
}

BackupProvider is implemented by every supported backup backend.

type Snapshot

type Snapshot struct {
	ID       string
	Time     time.Time
	Hostname string
	Tags     []string
	Paths    []string
}

Snapshot represents a single point-in-time backup snapshot.

type SnapshotMetadata

type SnapshotMetadata struct {
	SnapshotID    string
	ResticVersion string
	TotalSize     int64
	FileCount     int
	HasSummary    bool
}

SnapshotMetadata describes the contents of a snapshot.

Directories

Path Synopsis
Package restic implements the providers.BackupProvider interface for Restic repositories.
Package restic implements the providers.BackupProvider interface for Restic repositories.

Jump to

Keyboard shortcuts

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