summaryrefslogtreecommitdiff
path: root/vendor/github.com/minio/minio-go/v7/api.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-03-30 22:39:55 +0100
committerLibravatar GitHub <noreply@github.com>2023-03-30 22:39:55 +0100
commita5c920a50b3fe92fa7fa091347cfae729cd681c4 (patch)
tree850fdb1456e2c97c7bd81ed1b19731b836851f25 /vendor/github.com/minio/minio-go/v7/api.go
parent[frontend] Settings navigation design (#1652) (diff)
downloadgotosocial-a5c920a50b3fe92fa7fa091347cfae729cd681c4.tar.xz
bump go-store version (includes minio) (#1657)
Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/api.go')
-rw-r--r--vendor/github.com/minio/minio-go/v7/api.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/api.go b/vendor/github.com/minio/minio-go/v7/api.go
index 7ec7a620b..3b28519e0 100644
--- a/vendor/github.com/minio/minio-go/v7/api.go
+++ b/vendor/github.com/minio/minio-go/v7/api.go
@@ -106,6 +106,12 @@ type Options struct {
Region string
BucketLookup BucketLookupType
+ // Allows setting a custom region lookup based on URL pattern
+ // not all URL patterns are covered by this library so if you
+ // have a custom endpoints with many regions you can use this
+ // function to perform region lookups appropriately.
+ CustomRegionViaURL func(u url.URL) string
+
// TrailingHeaders indicates server support of trailing headers.
// Only supported for v4 signatures.
TrailingHeaders bool
@@ -118,7 +124,7 @@ type Options struct {
// Global constants.
const (
libraryName = "minio-go"
- libraryVersion = "v7.0.49"
+ libraryVersion = "v7.0.50"
)
// User Agent should always following the below style.
@@ -234,7 +240,11 @@ func privateNew(endpoint string, opts *Options) (*Client, error) {
// Sets custom region, if region is empty bucket location cache is used automatically.
if opts.Region == "" {
- opts.Region = s3utils.GetRegionFromURL(*clnt.endpointURL)
+ if opts.CustomRegionViaURL != nil {
+ opts.Region = opts.CustomRegionViaURL(*clnt.endpointURL)
+ } else {
+ opts.Region = s3utils.GetRegionFromURL(*clnt.endpointURL)
+ }
}
clnt.region = opts.Region