persistence

package
v2.0.7+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2016 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MSQLDMP_CONNECT_CMD string = "%s -u %s -h %s --password=%s"
	MSQLDMP_CREATE_CMD         = "%s < %s"
	MSQLDMP_FLUSH_CMD          = "%s > flush privileges"
	MSQLDMP_DUMP_CMD           = "%s --all-databases"
)
View Source
const (
	PGDMP_DROP_CMD   string = "drop schema public cascade;"
	PGDMP_CREATE_CMD        = "create schema public;"
)

Variables

View Source
var (
	MSQLDMP_DUMP_BIN string = "/var/vcap/packages/mariadb/bin/mysqldump"
	MSQLDMP_SQL_BIN         = "/var/vcap/packages/mariadb/bin/mysql"
)
View Source
var (
	PGDMP_DUMP_BIN    string = "/var/vcap/packages/postgres/bin/pg_dump"
	PGDMP_RESTORE_BIN string = "/var/vcap/packages/postgres/bin/pg_restore"
)

Functions

This section is empty.

Types

type MysqlDump

type MysqlDump struct {
	Ip         string
	Username   string
	Password   string
	DbFile     string
	ConfigFile string
	Caller     command.Executer
	RemoteOps  remoteOperationsInterface
}

func NewMysqlDump

func NewMysqlDump(ip, username, password string) *MysqlDump

func NewRemoteMysqlDump

func NewRemoteMysqlDump(username, password string, sshCfg command.SshConfig) (*MysqlDump, error)

func (*MysqlDump) Dump

func (s *MysqlDump) Dump(dest io.Writer) (err error)

func (*MysqlDump) Import

func (s *MysqlDump) Import(lfile io.Reader) (err error)

type PgDump

type PgDump struct {
	Ip        string
	Port      int
	Database  string
	Username  string
	Password  string
	DbFile    string
	Caller    command.Executer
	RemoteOps remoteOperationsInterface
	// contains filtered or unexported fields
}

func NewPgDump

func NewPgDump(ip string, port int, database, username, password string) *PgDump

func NewPgRemoteDump

func NewPgRemoteDump(port int, database, username, password string, sshCfg command.SshConfig) (*PgDump, error)

func (*PgDump) Dump

func (s *PgDump) Dump(dest io.Writer) (err error)

func (*PgDump) Import

func (s *PgDump) Import(lfile io.Reader) (err error)

Jump to

Keyboard shortcuts

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