diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3584adc7..e6603bd3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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/*" diff --git a/s3/s3.go b/s3/s3.go index 12c22151..da328a51 100644 --- a/s3/s3.go +++ b/s3/s3.go @@ -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