Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
*.out
test
.idea
42 changes: 0 additions & 42 deletions barkup.coverprofile

This file was deleted.

9 changes: 3 additions & 6 deletions postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import (
"time"
)

var (
// PGDumpCmd is the path to the `pg_dump` executable
PGDumpCmd = "pg_dump"
)

// Postgres is an `Exporter` interface that backs up a Postgres database via the `pg_dump` command
type Postgres struct {
// DB Host (e.g. 127.0.0.1)
Expand All @@ -21,6 +16,8 @@ type Postgres struct {
DB string
// Connection Username
Username string
// PGDumpCmd is the path to the `pg_dump` executable
PGDumpCmd string "pg_dump"
// Extra pg_dump options
// e.g []string{"--inserts"}
Options []string
Expand All @@ -31,7 +28,7 @@ func (x Postgres) Export() *ExportResult {
result := &ExportResult{MIME: "application/x-tar"}
result.Path = fmt.Sprintf(`bu_%v_%v.sql.tar.gz`, x.DB, time.Now().Unix())
options := append(x.dumpOptions(), "-Fc", fmt.Sprintf(`-f%v`, result.Path))
out, err := exec.Command(PGDumpCmd, options...).Output()
out, err := exec.Command(x.PGDumpCmd, options...).Output()
if err != nil {
result.Error = makeErr(err, string(out))
}
Expand Down
4 changes: 2 additions & 2 deletions s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package barkup

import (
"bufio"
"launchpad.net/goamz/aws"
"launchpad.net/goamz/s3"
"gopkg.in/amz.v1/aws"
"gopkg.in/amz.v1/s3"
"os"
)

Expand Down
2 changes: 1 addition & 1 deletion s3_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package barkup

import (
"launchpad.net/goamz/aws"
"gopkg.in/amz.v1/aws"
"os"
"testing"
)
Expand Down