Documentation
¶
Index ¶
- func RegisterAdapter(adapter DBAdapter)
- type BackUpOptions
- type ConnectionParams
- type DBAdapter
- type DryRunRunner
- type LocalRunner
- type MysqlAdapter
- func (ma *MysqlAdapter) BuildConnection(ctx context.Context, conn ConnectionParams) (string, error)
- func (ma *MysqlAdapter) Name() string
- func (ma *MysqlAdapter) RunBackup(ctx context.Context, conn ConnectionParams, runner Runner, w io.Writer) error
- func (ma *MysqlAdapter) RunRestore(ctx context.Context, conn ConnectionParams, runner Runner, r io.Reader) error
- func (ma *MysqlAdapter) SetLogger(l *logger.Logger)
- func (ma *MysqlAdapter) TestConnection(ctx context.Context, conn ConnectionParams, runner Runner) error
- type PostgresAdapter
- func (pa *PostgresAdapter) BuildConnection(ctx context.Context, conn ConnectionParams) (string, error)
- func (pa *PostgresAdapter) Name() string
- func (pa *PostgresAdapter) RunBackup(ctx context.Context, conn ConnectionParams, runner Runner, w io.Writer) error
- func (pa *PostgresAdapter) RunRestore(ctx context.Context, conn ConnectionParams, runner Runner, r io.Reader) error
- func (pa *PostgresAdapter) SetLogger(l *logger.Logger)
- func (pa *PostgresAdapter) TestConnection(ctx context.Context, conn ConnectionParams, runner Runner) error
- type Runner
- type SqliteAdapter
- func (sq *SqliteAdapter) BuildConnection(ctx context.Context, connParams ConnectionParams) (string, error)
- func (sq *SqliteAdapter) Name() string
- func (sq *SqliteAdapter) RunBackup(ctx context.Context, conn ConnectionParams, runner Runner, w io.Writer) error
- func (sq *SqliteAdapter) RunRestore(ctx context.Context, conn ConnectionParams, runner Runner, r io.Reader) error
- func (sq *SqliteAdapter) SetLogger(l *logger.Logger)
- func (sq *SqliteAdapter) TestConnection(ctx context.Context, connParams ConnectionParams, runner Runner) error
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAdapter ¶
func RegisterAdapter(adapter DBAdapter)
Types ¶
type BackUpOptions ¶
type ConnectionParams ¶
type ConnectionParams struct {
DBType string
DBName string
Password string
User string
Host string
Port int
DBUri string
TLS TLSConfig
IsPhysical bool
}
func (*ConnectionParams) ParseURI ¶
func (c *ConnectionParams) ParseURI() error
type DBAdapter ¶
type DBAdapter interface {
Name() string
TestConnection(ctx context.Context, conn ConnectionParams, runner Runner) error
BuildConnection(ctx context.Context, conn ConnectionParams) (string, error)
RunBackup(ctx context.Context, conn ConnectionParams, runner Runner, w io.Writer) error
RunRestore(ctx context.Context, conn ConnectionParams, runner Runner, r io.Reader) error
SetLogger(l *logger.Logger)
}
func GetAdapter ¶
type DryRunRunner ¶
type DryRunRunner struct {
// contains filtered or unexported fields
}
func NewDryRunRunner ¶
func NewDryRunRunner(l *logger.Logger) *DryRunRunner
type LocalRunner ¶
type LocalRunner struct {
// contains filtered or unexported fields
}
func NewLocalRunner ¶
func NewLocalRunner(l *logger.Logger) *LocalRunner
type MysqlAdapter ¶
type MysqlAdapter struct {
// contains filtered or unexported fields
}
func (*MysqlAdapter) BuildConnection ¶
func (ma *MysqlAdapter) BuildConnection(ctx context.Context, conn ConnectionParams) (string, error)
func (*MysqlAdapter) Name ¶
func (ma *MysqlAdapter) Name() string
func (*MysqlAdapter) RunBackup ¶
func (ma *MysqlAdapter) RunBackup(ctx context.Context, conn ConnectionParams, runner Runner, w io.Writer) error
func (*MysqlAdapter) RunRestore ¶
func (ma *MysqlAdapter) RunRestore(ctx context.Context, conn ConnectionParams, runner Runner, r io.Reader) error
func (*MysqlAdapter) SetLogger ¶
func (ma *MysqlAdapter) SetLogger(l *logger.Logger)
func (*MysqlAdapter) TestConnection ¶
func (ma *MysqlAdapter) TestConnection(ctx context.Context, conn ConnectionParams, runner Runner) error
type PostgresAdapter ¶
type PostgresAdapter struct {
// contains filtered or unexported fields
}
func (*PostgresAdapter) BuildConnection ¶
func (pa *PostgresAdapter) BuildConnection(ctx context.Context, conn ConnectionParams) (string, error)
func (*PostgresAdapter) Name ¶
func (pa *PostgresAdapter) Name() string
func (*PostgresAdapter) RunBackup ¶
func (pa *PostgresAdapter) RunBackup(ctx context.Context, conn ConnectionParams, runner Runner, w io.Writer) error
func (*PostgresAdapter) RunRestore ¶
func (pa *PostgresAdapter) RunRestore(ctx context.Context, conn ConnectionParams, runner Runner, r io.Reader) error
func (*PostgresAdapter) SetLogger ¶
func (pa *PostgresAdapter) SetLogger(l *logger.Logger)
func (*PostgresAdapter) TestConnection ¶
func (pa *PostgresAdapter) TestConnection(ctx context.Context, conn ConnectionParams, runner Runner) error
type SqliteAdapter ¶
func (*SqliteAdapter) BuildConnection ¶
func (sq *SqliteAdapter) BuildConnection(ctx context.Context, connParams ConnectionParams) (string, error)
func (*SqliteAdapter) Name ¶
func (sq *SqliteAdapter) Name() string
func (*SqliteAdapter) RunBackup ¶
func (sq *SqliteAdapter) RunBackup(ctx context.Context, conn ConnectionParams, runner Runner, w io.Writer) error
func (*SqliteAdapter) RunRestore ¶
func (sq *SqliteAdapter) RunRestore(ctx context.Context, conn ConnectionParams, runner Runner, r io.Reader) error
func (*SqliteAdapter) SetLogger ¶
func (sq *SqliteAdapter) SetLogger(l *logger.Logger)
func (*SqliteAdapter) TestConnection ¶
func (sq *SqliteAdapter) TestConnection(ctx context.Context, connParams ConnectionParams, runner Runner) error
Click to show internal directories.
Click to hide internal directories.