backup

package
v0.11.1-0...-8ab92b3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Databases

func Databases(ctx context.Context, docker client.ContainerAPIClient, containerID, compatibility string) ([]string, error)

Databases is used to get a list of all the databases for a specific engine. It is returned as a slice of strings using the containers hostname (e.g. mysql-8.0-3306) so it can be presented to the user as a list.

func Perform

func Perform(ctx context.Context, docker client.ContainerAPIClient, opts *Options) error

Perform is used to perform a backup for a database container, it does not prompt the user as it assumed the Prompt func above is used to determine the engine (container) and the specific database to backup. Perform accepts the backup commands and is agnostic to the database engine for the requested backup.

func Prompt

func Prompt(ctx context.Context, reader io.Reader, docker client.ContainerAPIClient, output terminal.Outputer, containers []types.Container, containerList []string) (string, string, string, string, error)

Prompt is used to ask a user for input and walk them through selecting a database engine (container) and a database. It will return the container ID as the first string, the database name, and the last return is an error.

Types

type Options

type Options struct {
	Home          string
	ContainerID   string
	ContainerName string
	Database      string
	BackupName    string
	Commands      []string
}

Options are used to pass options to a database backup func. The options contain information such as the container, home directory, and database to backup.

func (*Options) Validate

func (o *Options) Validate() error

Jump to

Keyboard shortcuts

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