provider

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PGDumpCmd default dump command for Postgres.
	PGDumpCmd = "pg_dump"
	// PGImportCmd default import command for Postgres.
	PGImportCmd = "psql"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionFailedError

type ExecutionFailedError struct {
	Command string
	Message string
}

ExecutionFailedError occurs when an execution fails.

func (ExecutionFailedError) Error

func (e ExecutionFailedError) Error() string

type Postgres

type Postgres struct {
	Host     string
	Port     string
	Name     string
	Username string
	Password string
	// Extra pg_dump options
	// e.g []string{"--inserts"}
	Options   []string
	Commander internal.Commander
}

Postgres provider.

func (Postgres) Export

func (db Postgres) Export(backup *backup.Backup) error

Export returns backup with dumped file.

func (Postgres) Import

func (db Postgres) Import(backup *backup.Backup) error

Import imports given file to Postgres provider.

func (*Postgres) SetCommander

func (db *Postgres) SetCommander(commander internal.Commander)

SetCommander sets commander for Postgres.

type TypeError

type TypeError struct {
	Type string
}

TypeError occurs when Database type is not supported.

func (TypeError) Error

func (e TypeError) Error() string

Jump to

Keyboard shortcuts

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