✨ Auto to set bucket lookup method
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
pkg "git.solsynth.dev/hypernet/paperclip/pkg/internal"
|
||||
"git.solsynth.dev/hypernet/paperclip/pkg/internal/database"
|
||||
"github.com/samber/lo"
|
||||
|
||||
@@ -121,9 +122,11 @@ func DeleteFileFromLocal(config models.LocalDestination, uuid string) error {
|
||||
|
||||
func DeleteFileFromS3(config models.S3Destination, uuid string) error {
|
||||
client, err := minio.New(config.Endpoint, &minio.Options{
|
||||
Creds: credentials.NewStaticV4(config.SecretID, config.SecretKey, ""),
|
||||
Secure: config.EnableSSL,
|
||||
Creds: credentials.NewStaticV4(config.SecretID, config.SecretKey, ""),
|
||||
Secure: config.EnableSSL,
|
||||
BucketLookup: minio.BucketLookupType(config.BucketLookup),
|
||||
})
|
||||
client.SetAppInfo("HyperNet.Paperclip", pkg.AppVersion)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to configure s3 client: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user