backup

package
v1.12.1 Latest Latest
Warning

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

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

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