backup

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ConnectTimeoutSeconds = 5

ConnectTimeoutSeconds is the timeout for database connections (in seconds) Used for backup, restore, and connection testing

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(result *Result)

Cleanup removes the temporary backup file

func CompressionFromFilename

func CompressionFromFilename(filename string) string

CompressionFromFilename detects compression type from file extension

func CompressionLabel

func CompressionLabel(compression string) string

CompressionLabel returns a human-readable label for the compression type

func Restore

func Restore(db config.Database, backupPath string) error

Restore restores a backup file to the given database

func TestConnection

func TestConnection(db config.Database) error

TestConnection tests database connectivity with a timeout. Supports mysql and postgres database types.

Types

type Result

type Result struct {
	Name     string
	Filename string
	Path     string
	Size     int64
	Duration time.Duration
	Error    error
}

Result contains the outcome of a backup operation

func Run

func Run(name string, db config.Database) (*Result, error)

Run performs a backup for the given database and returns the local file path

Jump to

Keyboard shortcuts

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