Documentation ¶
Index ¶
Constants ¶
View Source
const BackupFilenamePrefix = "tbl_backup"
BackupFilenamePrefix is the prefix used in every backup file.
Variables ¶
This section is empty.
Functions ¶
func Decompress ¶
Decompress decompresses a zstd file.
Types ¶
type BackupResult ¶
type BackupResult struct { Timestamp time.Time Path string // Stats ElapsedTime time.Duration VacuumElapsedTime time.Duration CompressionElapsedTime time.Duration Size int64 SizeAfterVacuum int64 SizeAfterCompression int64 }
BackupResult represents the result of a backup process.
type Backuper ¶
type Backuper struct {
// contains filtered or unexported fields
}
Backuper is the process that executes the backup process.
func NewBackuper ¶
NewBackuper creates a new backuper responsible for making backups of a SQLite database.
type BackuperOptions ¶
BackuperOptions options needed to instantiate a backuper.
type DB ¶
type DB interface { Close() error Ping() error SetMaxOpenConns(n int) Conn(context.Context) (*sql.Conn, error) Exec(query string, args ...interface{}) (sql.Result, error) // new Path() string }
DB is a subset of *sql.DB operations used in Backuper. This interfaces aids with testing.
type Option ¶
Option modifies a configuration attribute.
func WithPruning ¶
WithPruning enables pruning of old backup files.
type Scheduler ¶
type Scheduler struct { NotificationCh chan error // contains filtered or unexported fields }
Scheduler executes backups at a regular interval.
func NewScheduler ¶
func NewScheduler(frequency int, opts BackuperOptions, notify bool) (*Scheduler, error)
NewScheduler creates a new backup scheduler.
Click to show internal directories.
Click to hide internal directories.