Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Paweł Głazik <zytek@nuxi.pl>
  • Loading branch information
zytek committed Nov 5, 2019
1 parent 33db25f commit b59bbca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
15 changes: 14 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@ import (
"os/signal"
)

func setup() Config {
type BucketConfig struct {
Region string
Bucket string
Prefix string
Profile string
}

type Config struct {
Source BucketConfig
Destination BucketConfig
Parallel int
}

func readConfig() Config {
var config Config

var configFile string
Expand Down
18 changes: 4 additions & 14 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,9 @@ import (
"log"
)

type BucketConfig struct {
Region string
Bucket string
Prefix string
Profile string
}

type Config struct {
Source BucketConfig
Destination BucketConfig
Parallel int
}

func main() {

config := setup()
config := readConfig()
sessSource := session.Must(session.NewSession(&aws.Config{
Region: aws.String(config.Source.Region),
Credentials: credentials.NewSharedCredentials("", config.Source.Profile),
Expand All @@ -41,11 +28,14 @@ func main() {

source := NewBucket(config.Source.Bucket, config.Source.Prefix, sessSource, ctx)
dest := NewBucket(config.Destination.Bucket, config.Destination.Prefix, sessDest, ctx)

j := job{
source: source,
destination: dest,
copyChan: make(chan string, config.Parallel),
}

j.Start()

log.Println("All done")
}

0 comments on commit b59bbca

Please sign in to comment.