diff --git a/.gitignore b/.gitignore index 46aa263..edd2153 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store *.out test +.idea diff --git a/barkup.coverprofile b/barkup.coverprofile deleted file mode 100644 index 9dba511..0000000 --- a/barkup.coverprofile +++ /dev/null @@ -1,42 +0,0 @@ -mode: count -github.com/keighl/barkup/barkup.go:22.31,24.2 1 1 -github.com/keighl/barkup/barkup.go:26.44,27.16 1 8 -github.com/keighl/barkup/barkup.go:33.2,33.12 1 3 -github.com/keighl/barkup/barkup.go:27.16,32.3 1 5 -github.com/keighl/barkup/barkup.go:56.66,57.18 1 3 -github.com/keighl/barkup/barkup.go:62.2,63.21 2 2 -github.com/keighl/barkup/barkup.go:67.2,68.25 2 1 -github.com/keighl/barkup/barkup.go:57.18,60.3 2 1 -github.com/keighl/barkup/barkup.go:63.21,65.3 1 1 -github.com/keighl/barkup/barkup.go:72.41,75.2 2 3 -github.com/keighl/barkup/mysql.go:35.39,42.16 5 3 -github.com/keighl/barkup/mysql.go:47.2,49.16 3 2 -github.com/keighl/barkup/mysql.go:53.2,55.15 2 1 -github.com/keighl/barkup/mysql.go:42.16,45.3 2 1 -github.com/keighl/barkup/mysql.go:49.16,52.3 2 1 -github.com/keighl/barkup/mysql.go:58.39,66.2 7 4 -github.com/keighl/barkup/postgres.go:30.42,35.16 5 2 -github.com/keighl/barkup/postgres.go:38.2,38.15 1 2 -github.com/keighl/barkup/postgres.go:35.16,37.3 1 1 -github.com/keighl/barkup/postgres.go:41.42,44.16 2 8 -github.com/keighl/barkup/postgres.go:48.2,48.18 1 8 -github.com/keighl/barkup/postgres.go:52.2,52.18 1 8 -github.com/keighl/barkup/postgres.go:56.2,56.22 1 8 -github.com/keighl/barkup/postgres.go:60.2,60.16 1 8 -github.com/keighl/barkup/postgres.go:44.16,46.3 1 5 -github.com/keighl/barkup/postgres.go:48.18,50.3 1 3 -github.com/keighl/barkup/postgres.go:52.18,54.3 1 4 -github.com/keighl/barkup/postgres.go:56.22,58.3 1 6 -github.com/keighl/barkup/rethinkdb.go:31.43,36.16 5 2 -github.com/keighl/barkup/rethinkdb.go:39.2,39.15 1 2 -github.com/keighl/barkup/rethinkdb.go:36.16,38.3 1 1 -github.com/keighl/barkup/rethinkdb.go:42.43,45.35 3 3 -github.com/keighl/barkup/rethinkdb.go:48.2,48.16 1 3 -github.com/keighl/barkup/rethinkdb.go:45.35,47.3 1 2 -github.com/keighl/barkup/s3.go:31.67,33.25 1 3 -github.com/keighl/barkup/s3.go:37.2,38.16 2 2 -github.com/keighl/barkup/s3.go:41.2,45.16 4 2 -github.com/keighl/barkup/s3.go:49.2,60.25 6 2 -github.com/keighl/barkup/s3.go:33.25,35.3 1 1 -github.com/keighl/barkup/s3.go:38.16,40.3 1 0 -github.com/keighl/barkup/s3.go:45.16,47.3 1 0 diff --git a/postgres.go b/postgres.go index 46b4a08..7fb8034 100644 --- a/postgres.go +++ b/postgres.go @@ -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) @@ -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 @@ -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)) } diff --git a/s3.go b/s3.go index 081d053..07b7abd 100644 --- a/s3.go +++ b/s3.go @@ -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" ) diff --git a/s3_test.go b/s3_test.go index 43f4c0e..0f647a7 100644 --- a/s3_test.go +++ b/s3_test.go @@ -1,7 +1,7 @@ package barkup import ( - "launchpad.net/goamz/aws" + "gopkg.in/amz.v1/aws" "os" "testing" )