driver

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBConfig

type DBConfig struct {
	DBName   string
	Username string
	Password string
	Host     string
	Port     int
}

func NewDBConfig

func NewDBConfig(dbName, user, password, host string, port int) *DBConfig

type Driver

type Driver interface {
	Close() error
	ExecDumpEnviron() ([]string, error)
	GetExecDumpCommand() (string, []string, error)
	GetSshDumpCommand() (string, error)
}

type MysqlDriver

type MysqlDriver struct {
	MysqlDumpBinaryPath string
	Options             []string
	ViaSsh              bool
	*DBConfig
	// contains filtered or unexported fields
}

func NewMysqlDriver

func NewMysqlDriver(dsn string, options []string, viaSsh bool) (*MysqlDriver, error)

Create the mysql dump driver.

func (*MysqlDriver) Close added in v0.4.0

func (mysql *MysqlDriver) Close() error

Cleanup the credentials file.

func (*MysqlDriver) ExecDumpEnviron added in v0.4.0

func (mysql *MysqlDriver) ExecDumpEnviron() ([]string, error)

Get the required environment variables for running exec dump.

func (*MysqlDriver) GetExecDumpCommand added in v0.4.0

func (mysql *MysqlDriver) GetExecDumpCommand() (string, []string, error)

Get the exec dump command.

func (*MysqlDriver) GetSshDumpCommand

func (mysql *MysqlDriver) GetSshDumpCommand() (string, error)

Get dump command used by ssh dumper.

type PostgreSqlDriver added in v0.4.0

type PostgreSqlDriver struct {
	PgDumpBinaryPath string
	Options          []string
	ViaSsh           bool
	*DBConfig
	// contains filtered or unexported fields
}

func NewPostgreSqlDriver added in v0.4.0

func NewPostgreSqlDriver(dsn string, options []string, viaSsh bool) (*PostgreSqlDriver, error)

Create the postgressql dump driver. Dsn example: postgres://username:password@localhost:5432/database_name"

func (*PostgreSqlDriver) Close added in v0.4.0

func (psql *PostgreSqlDriver) Close() error

Cleanup the credentials file.

func (*PostgreSqlDriver) ExecDumpEnviron added in v0.4.0

func (psql *PostgreSqlDriver) ExecDumpEnviron() ([]string, error)

Get the required environment variables for running exec dump.

func (*PostgreSqlDriver) GetExecDumpCommand added in v0.4.0

func (psql *PostgreSqlDriver) GetExecDumpCommand() (string, []string, error)

Get the exec dump command.

func (*PostgreSqlDriver) GetSshDumpCommand added in v0.4.0

func (psql *PostgreSqlDriver) GetSshDumpCommand() (string, error)

Get the ssh dump command.

Jump to

Keyboard shortcuts

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