backup

package
v1.16.4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(dbPath string, dbName string, backupFilePattern string, restoreFilePattern string) *Manager

NewManager creates a new backup manager Each instance of a Manager can run 1 backup or restore at a time (internally uses a mutex) It is safe to create multiple instances of Manager which could run Backups/Restores concurrently

func (*Manager) AddValidationQueries

func (m *Manager) AddValidationQueries(queries ...string)

AddValidationQueries Adds queries to run on a restored database to ensure meets some criteria These queries should cause db.Exec to return error if the database imported is invalid. For example, if the database does not have a vital table

func (*Manager) MakeBackupFile

func (m *Manager) MakeBackupFile(ctx context.Context) (string, error)

MakeBackupFile returns a string path of the sqlite database backup

func (*Manager) RestoreToFile

func (m *Manager) RestoreToFile(ctx context.Context, stream io.Reader) (string, error)

RestoreToFile returns a string path of the sqlite database restored from the stream

Jump to

Keyboard shortcuts

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