s3utils

package
v7.0.64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 9 Imported by: 122

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckValidBucketName

func CheckValidBucketName(bucketName string) (err error)

CheckValidBucketName - checks if we have a valid input bucket name.

func CheckValidBucketNameStrict

func CheckValidBucketNameStrict(bucketName string) (err error)

CheckValidBucketNameStrict - checks if we have a valid input bucket name. This is a stricter version. - http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html

func CheckValidObjectName

func CheckValidObjectName(objectName string) error

CheckValidObjectName - checks if we have a valid input object name.

func CheckValidObjectNamePrefix

func CheckValidObjectNamePrefix(objectName string) error

CheckValidObjectNamePrefix - checks if we have a valid input object name prefix.

func EncodePath

func EncodePath(pathName string) string

EncodePath encode the strings from UTF-8 byte representations to HTML hex escape sequences

This is necessary since regular url.Parse() and url.Encode() functions do not support UTF-8 non english characters cannot be parsed due to the nature in which url.Encode() is written

This function on the other hand is a direct replacement for url.Encode() technique to support pretty much every UTF-8 character.

func GetRegionFromURL

func GetRegionFromURL(endpointURL url.URL) string

GetRegionFromURL - returns a region from url host.

func IsAliyunOSSEndpoint

func IsAliyunOSSEndpoint(endpointURL url.URL) bool

IsAliyunOSSEndpoint - Match if it is exactly Aliyun OSS endpoint.

func IsAmazonEndpoint

func IsAmazonEndpoint(endpointURL url.URL) bool

IsAmazonEndpoint - Match if it is exactly Amazon S3 endpoint.

func IsAmazonFIPSEndpoint

func IsAmazonFIPSEndpoint(endpointURL url.URL) bool

IsAmazonFIPSEndpoint - Match if it is exactly Amazon S3 FIPS endpoint. See https://aws.amazon.com/compliance/fips.

func IsAmazonFIPSGovCloudEndpoint

func IsAmazonFIPSGovCloudEndpoint(endpointURL url.URL) bool

IsAmazonFIPSGovCloudEndpoint - match if the endpoint is FIPS and GovCloud.

func IsAmazonGovCloudEndpoint

func IsAmazonGovCloudEndpoint(endpointURL url.URL) bool

IsAmazonGovCloudEndpoint - Match if it is exactly Amazon S3 GovCloud endpoint.

func IsAmazonPrivateLinkEndpoint added in v7.0.17

func IsAmazonPrivateLinkEndpoint(endpointURL url.URL) bool

IsAmazonPrivateLinkEndpoint - Match if it is exactly Amazon S3 PrivateLink interface endpoint See https://docs.aws.amazon.com/AmazonS3/latest/userguide/privatelink-interface-endpoints.html.

func IsGoogleEndpoint

func IsGoogleEndpoint(endpointURL url.URL) bool

IsGoogleEndpoint - Match if it is exactly Google cloud storage endpoint.

func IsValidDomain

func IsValidDomain(host string) bool

IsValidDomain validates if input string is a valid domain name.

func IsValidIP

func IsValidIP(ip string) bool

IsValidIP parses input string for ip address validity.

func IsVirtualHostSupported

func IsVirtualHostSupported(endpointURL url.URL, bucketName string) bool

IsVirtualHostSupported - verifies if bucketName can be part of virtual host. Currently only Amazon S3 and Google Cloud Storage would support this.

func QueryEncode

func QueryEncode(v url.Values) string

QueryEncode - encodes query values in their URL encoded form. In addition to the percent encoding performed by urlEncodePath() used here, it also percent encodes '/' (forward slash)

func TagDecode

func TagDecode(ctag string) map[string]string

TagDecode - decodes canonical tag into map of key and value.

func TagEncode

func TagEncode(tags map[string]string) string

TagEncode - encodes tag values in their URL encoded form. In addition to the percent encoding performed by urlEncodePath() used here, it also percent encodes '/' (forward slash)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL