Skip to content

Commit

Permalink
🔥 several updates for s3 (#322)
Browse files Browse the repository at this point in the history
* updates for s3.

* fix linter
  • Loading branch information
efectn authored Feb 4, 2022
1 parent 45cc6b9 commit 61fa970
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,12 @@ updates:
automerged_updates:
- match:
dependency_name: "gofiber/fiber/*"
- package-ecosystem: "gomod"
directory: "/s3/" # Location of package manifests
default_labels:
- "🤖 Dependencies"
schedule:
interval: "daily"
automerged_updates:
- match:
dependency_name: "gofiber/fiber/*"
11 changes: 10 additions & 1 deletion s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,22 @@ func New(config ...Config) *Storage {
}

sess := s3.NewFromConfig(awscfg)
return &Storage{
storage := &Storage{
svc: sess,
downloader: manager.NewDownloader(sess),
uploader: manager.NewUploader(sess),
requestTimeout: cfg.RequestTimeout,
bucket: cfg.Bucket,
}

// Reset all entries if set to true
if cfg.Reset {
if err := storage.Reset(); err != nil {
panic(err)
}
}

return storage
}

// Get value by key
Expand Down

0 comments on commit 61fa970

Please sign in to comment.