database

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	DatabaseInitializer
	DatabaseProber
}

type DatabaseInitializer

type DatabaseInitializer interface {
	// Check indicates whether a restore of the database is required or not.
	Check(ctx context.Context) (bool, error)

	// Recover performs a restore of the database.
	Recover(ctx context.Context) error

	// Upgrade performs an upgrade of the database in case a newer version of the database is detected.
	//
	// The function aborts the update without returning an error as long as the old data stays unmodified and only logs the error.
	// This behavior is intended to reduce unnecessary downtime caused by misconfigurations.
	//
	// Once the upgrade was made, any error condition will require to recover the database from backup.
	Upgrade(ctx context.Context) error
}

type DatabaseProber

type DatabaseProber interface {
	// Probe figures out if the database is running and available for taking backups.
	Probe(ctx context.Context) error

	// Backup creates a backup of the database.
	Backup(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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