backup

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

internal/backup/archive.go

internal/backup/manager.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateArchive

func CreateArchive(srcDir, destPath string) error

CreateArchive compresses the contents of srcDir into a .tar.gz at destPath. The archive stores paths relative to srcDir.

func TimestampedFilename

func TimestampedFilename() string

TimestampedFilename returns a UTC timestamped filename in gsbt format.

Types

type Manager

type Manager struct {
	TempDir        string
	BackupLocation string
	Progress       progress.Reporter
}

Manager coordinates backup operations for a single server.

func (*Manager) Backup

func (m *Manager) Backup(ctx context.Context, conn connector.Connector) (string, Stats, error)

Backup pulls files via connector, archives them, and writes to backup location.

func (*Manager) Restore

func (m *Manager) Restore(ctx context.Context, conn connector.Connector, r io.Reader) error

Restore uploads an archive's contents back to the remote via connector. Not implemented yet; placeholder for future work.

type Stats

type Stats struct {
	Files    int
	Bytes    int64
	Duration time.Duration
}

Stats represents a summary of a backup run.

Jump to

Keyboard shortcuts

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