MCPcopy
hub / github.com/minio/minio-go / IsAmazonEndpoint

Function IsAmazonEndpoint

pkg/s3utils/utils.go:232–240  ·  view source on GitHub ↗

IsAmazonEndpoint - Match if it is exactly Amazon S3 endpoint. S3 on Outposts is not treated as Amazon S3 here so that the client keeps path-style and does not replace the host.

(endpointURL url.URL)

Source from the content-addressed store, hash-verified

230// IsAmazonEndpoint - Match if it is exactly Amazon S3 endpoint.
231// S3 on Outposts is not treated as Amazon S3 here so that the client keeps path-style and does not replace the host.
232func IsAmazonEndpoint(endpointURL url.URL) bool {
233 if IsAmazonOutpostsEndpoint(endpointURL) {
234 return false
235 }
236 if endpointURL.Hostname() == "s3-external-1.amazonaws.com" || endpointURL.Hostname() == "s3.amazonaws.com" {
237 return true
238 }
239 return GetRegionFromURL(endpointURL) != ""
240}
241
242// IsAmazonGovCloudEndpoint - Match if it is exactly Amazon S3 GovCloud endpoint.
243func IsAmazonGovCloudEndpoint(endpointURL url.URL) bool {

Callers 10

NewFunction · 0.92
SetS3EnableDualstackMethod · 0.92
newRequestMethod · 0.92
makeTargetURLMethod · 0.92
isValidEndpointURLFunction · 0.92
TestIsAmazonEndpointFunction · 0.85
IsVirtualHostSupportedFunction · 0.85

Calls 2

IsAmazonOutpostsEndpointFunction · 0.85
GetRegionFromURLFunction · 0.85

Tested by 1

TestIsAmazonEndpointFunction · 0.68