Documentation
¶
Index ¶
- Variables
- func CommandExist(command string) bool
- type Dump
- func (x *Dump) EnableVerbose()
- func (x *Dump) Exec(opts ExecOptions) Result
- func (x *Dump) GetFileName() string
- func (x *Dump) IgnoreTableDataToString() []string
- func (x *Dump) ResetOptions()
- func (x *Dump) SetFileName(filename string)
- func (x *Dump) SetPath(path string)
- func (x *Dump) SetupFormat(f string)
- type ErrCommandNotFound
- type ExecOptions
- type Postgres
- type Restore
- type Result
- type ResultError
- type Results
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// PGDumpCmd is the path to the `pg_dump` executable
PGDumpCmd = "pg_dump"
)
View Source
var (
// PGRestoreCmd is the path to the `pg_restore` executable
PGRestoreCmd = "pg_restore"
)
Functions ¶
func CommandExist ¶ added in v0.2.2
Types ¶
type Dump ¶
type Dump struct {
*Postgres
// Verbose mode
Verbose bool
// Path: setup path dump out
Path string
// Format: output file format (custom, directory, tar, plain text (default))
Format *string
// Extra pg_dump x.FullOptions
// e.g []string{"--inserts"}
Options []string
IgnoreTableData []string
// contains filtered or unexported fields
}
Dump is an `Exporter` interface that backs up a Postgres database via the `pg_dump` command.
func (*Dump) EnableVerbose ¶
func (x *Dump) EnableVerbose()
func (*Dump) Exec ¶
func (x *Dump) Exec(opts ExecOptions) Result
Exec `pg_dump` of the specified database, and creates a gzip compressed tarball archive.
func (*Dump) GetFileName ¶
func (*Dump) IgnoreTableDataToString ¶
func (*Dump) ResetOptions ¶
func (x *Dump) ResetOptions()
func (*Dump) SetFileName ¶
func (*Dump) SetupFormat ¶
type ErrCommandNotFound ¶ added in v0.2.2
type ErrCommandNotFound struct {
Command string
}
func (ErrCommandNotFound) Error ¶ added in v0.2.2
func (e ErrCommandNotFound) Error() string
type ExecOptions ¶
type Postgres ¶
type Restore ¶
type Restore struct {
*Postgres
// Verbose mode
Verbose bool
// Role: do SET ROLE before restore
Role string
// Path: setup path for source restore
Path string
// Extra pg_dump options
// e.g []string{"--inserts"}
Options []string
// Schemas: list of database schema
Schemas []string
}
func NewRestore ¶
func (*Restore) EnableVerbose ¶
func (x *Restore) EnableVerbose()
func (*Restore) Exec ¶
func (x *Restore) Exec(filename string, opts ExecOptions) Result
Exec `pg_restore` of the specified database, and restore from a gzip compressed tarball archive.
func (*Restore) ResetOptions ¶
func (x *Restore) ResetOptions()
func (*Restore) SetSchemas ¶
type Result ¶
type Result struct {
Mine string
File string
Output string
Error *ResultError
FullCommand string
}
type ResultError ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.