Skip to content

Commit

Permalink
package structure
Browse files Browse the repository at this point in the history
  • Loading branch information
gavincabbage committed Mar 31, 2019
1 parent 99ebb01 commit f884449
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
cover.out
5 changes: 5 additions & 0 deletions cmd/chiv/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package main

func main() {

}
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ go 1.12

require (
github.com/aws/aws-sdk-go v1.18.6
github.com/golangci/golangci-lint v1.16.0 // indirect
github.com/lib/pq v1.0.0
github.com/stretchr/testify v1.3.0 // indirect
github.com/stretchr/testify v1.3.0
golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53 // indirect
golang.org/x/tools v0.0.0-20190330180304-aef51cc3777c // indirect
)
168 changes: 168 additions & 0 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions chiv.go → pkg/chiv.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package chiv archives arbitrarily large relational database tables to Amazon S3.
package chiv
package pkg

import (
"context"
Expand Down Expand Up @@ -47,7 +47,7 @@ func (a *Archiver) Archive(table, bucket string, options ...Option) error {
return a.ArchiveWithContext(context.Background(), table, bucket, options...)
}

// Archive a database table to S3 with context.
// ArchiveWithContext is like Archive, with context.
func (a *Archiver) ArchiveWithContext(ctx context.Context, table, bucket string, options ...Option) error {
archiver := archiver{
db: a.db,
Expand Down
4 changes: 2 additions & 2 deletions chiv_test.go → pkg/chiv_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package chiv_test includes integration tests external to package chiv
// and relies on external services postgres and s3 (localstack) via CodeShip.
package chiv_test
package pkg_test

import (
"database/sql"
Expand All @@ -18,7 +18,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/gavincabbage/chiv"
"github.com/gavincabbage/pkg/chiv"
)

func TestArchiver_Archive(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion formatters.go → pkg/formatters.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chiv
package pkg

import (
"database/sql"
Expand Down
2 changes: 1 addition & 1 deletion options.go → pkg/options.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chiv
package pkg

// Option configures the Archiver. Options can be provided when creating an Archiver or on each call to Archive.
type Option func(*Archiver)
Expand Down

0 comments on commit f884449

Please sign in to comment.