Package: s3
Overview
Upload Managers
The s3manager package’s Uploader provides concurrent upload of content to S3 by taking advantage of S3’s Multipart APIs. The Uploader also supports both io.Reader for streaming uploads, and will also take advantage of io.ReadSeeker for optimizations if the Body satisfies that type. Once the Uploader instance is created you can call Upload concurrently from multiple goroutines safely.
// The session the S3 Uploader will use
sess := session.Must(session.NewSession())
// Create an uploader with the session and default options
uploader := s3manager.NewUploader(sess)
f, err := os.Open(filename)
if err != nil {
return fmt.Errorf("failed to open file %q, %v", filename, err)
}
// Upload the file to S3.
result, err := uploader.Upload(&s3manager.UploadInput{
Bucket: aws.String(myBucket),
Key: aws.String(myString),
Body: f,
})
if err != nil {
return fmt.Errorf("failed to upload file, %v", err)
}
fmt.Printf("file uploaded to, %s\n", aws.StringValue(result.Location))
See the s3manager package’s Uploader type documentation for more information. docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#Uploader
Download Manager
The s3manager package’s Downloader provides concurrently downloading of Objects from S3. The Downloader will write S3 Object content with an io.WriterAt. Once the Downloader instance is created you can call Download concurrently from multiple goroutines safely.
// The session the S3 Downloader will use
sess := session.Must(session.NewSession())
// Create a downloader with the session and default options
downloader := s3manager.NewDownloader(sess)
// Create a file to write the S3 Object contents to.
f, err := os.Create(filename)
if err != nil {
return fmt.Errorf("failed to create file %q, %v", filename, err)
}
// Write the contents of S3 Object to the file
n, err := downloader.Download(f, &s3.GetObjectInput{
Bucket: aws.String(myBucket),
Key: aws.String(myString),
})
if err != nil {
return fmt.Errorf("failed to download file, %v", err)
}
fmt.Printf("file downloaded, %d bytes\n", n)
See the s3manager package’s Downloader type documentation for more information. docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#Downloader
Automatic URI cleaning
Interacting with objects whose keys contain adjacent slashes (e.g. bucketname/foo//bar/objectname) requires setting DisableRestProtocolURICleaning to true in the aws.Config struct used by the service client.
svc := s3.New(sess, &aws.Config{
DisableRestProtocolURICleaning: aws.Bool(true),
})
out, err := svc.GetObject(&s3.GetObjectInput {
Bucket: aws.String("bucketname"),
Key: aws.String("//foo//bar//moo"),
})
Get Bucket Region
GetBucketRegion will attempt to get the region for a bucket using a region hint to determine which AWS partition to perform the query on. Use this utility to determine the region a bucket is in.
sess := session.Must(session.NewSession())
bucket := "my-bucket"
region, err := s3manager.GetBucketRegion(ctx, sess, bucket, "us-west-2")
if err != nil {
if aerr, ok := err.(awserr.Error); ok && aerr.Code() == "NotFound" {
fmt.Fprintf(os.Stderr, "unable to find bucket %s's region not found\n", bucket)
}
return err
}
fmt.Printf("Bucket %s is in %s region\n", bucket, region)
See the s3manager package’s GetBucketRegion function documentation for more information docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#GetBucketRegion
S3 Crypto Client
The s3crypto package provides the tools to upload and download encrypted content from S3. The Encryption and Decryption clients can be used concurrently once the client is created.
See the s3crypto package documentation for more information. docs.aws.amazon.com/sdk-for-go/api/service/s3/s3crypto/
Client Structure collapse
-
S3
struct
client
WaitUntilBucketExists uses the Amazon S3 API operation HeadBucket to wait for a condition to be met before returning.
Constants
-
const BucketCannedACLPrivate = readonly
BucketCannedACLPrivate is a BucketCannedACL enum value
-
Value:
"private" -
const BucketCannedACLPublicRead = readonly
BucketCannedACLPublicRead is a BucketCannedACL enum value
-
Value:
"public-read" -
const BucketCannedACLPublicReadWrite = readonly
BucketCannedACLPublicReadWrite is a BucketCannedACL enum value
-
Value:
"public-read-write" -
const BucketCannedACLAuthenticatedRead = readonly
BucketCannedACLAuthenticatedRead is a BucketCannedACL enum value
-
Value:
"authenticated-read" -
const BucketLocationConstraintAuSydOnerateActive = readonly
BucketLocationConstraintAuSydOnerateActive is a BucketLocationConstraint enum value
-
Value:
"au-syd-onerate_active" -
const BucketLocationConstraintCaTorOnerateActive = readonly
BucketLocationConstraintCaTorOnerateActive is a BucketLocationConstraint enum value
-
Value:
"ca-tor-onerate_active" -
const BucketLocationConstraintBrSaoOnerateActive = readonly
BucketLocationConstraintBrSaoOnerateActive is a BucketLocationConstraint enum value
-
Value:
"br-sao-onerate_active" -
const BucketLocationConstraintJpOsaOnerateActive = readonly
BucketLocationConstraintJpOsaOnerateActive is a BucketLocationConstraint enum value
-
Value:
"jp-osa-onerate_active" -
const BucketLocationConstraintJpTokOnerateActive = readonly
BucketLocationConstraintJpTokOnerateActive is a BucketLocationConstraint enum value
-
Value:
"jp-tok-onerate_active" -
const BucketLocationConstraintEu = readonly
BucketLocationConstraintEu is a BucketLocationConstraint enum value
-
Value:
"EU" -
const BucketLocationConstraintUsEastOnerateActive = readonly
BucketLocationConstraintUsEastOnerateActive is a BucketLocationConstraint enum value
-
Value:
"us-east-onerate_active" -
const BucketLocationConstraintUsSouthOnerateActive = readonly
BucketLocationConstraintUsSouthOnerateActive is a BucketLocationConstraint enum value
-
Value:
"us-south-onerate_active" -
const BucketLocationConstraintUsWest1 = readonly
BucketLocationConstraintUsWest1 is a BucketLocationConstraint enum value
-
Value:
"us-west-1" -
const BucketLocationConstraintUsWest2 = readonly
BucketLocationConstraintUsWest2 is a BucketLocationConstraint enum value
-
Value:
"us-west-2" -
const BucketLocationConstraintEuGbOnerateActive = readonly
BucketLocationConstraintEuGbOnerateActive is a BucketLocationConstraint enum value
-
Value:
"eu-gb-onerate_active" -
const BucketLocationConstraintEuDeOnerateActive = readonly
BucketLocationConstraintEuDeOnerateActive is a BucketLocationConstraint enum value
-
Value:
"eu-de-onerate_active" -
const BucketLocationConstraintApSouth1 = readonly
BucketLocationConstraintApSouth1 is a BucketLocationConstraint enum value
-
Value:
"ap-south-1" -
const BucketLocationConstraintApSoutheast1 = readonly
BucketLocationConstraintApSoutheast1 is a BucketLocationConstraint enum value
-
Value:
"ap-southeast-1" -
const BucketLocationConstraintApSoutheast2 = readonly
BucketLocationConstraintApSoutheast2 is a BucketLocationConstraint enum value
-
Value:
"ap-southeast-2" -
const BucketLocationConstraintApNortheast1 = readonly
BucketLocationConstraintApNortheast1 is a BucketLocationConstraint enum value
-
Value:
"ap-northeast-1" -
const BucketLocationConstraintSaEast1 = readonly
BucketLocationConstraintSaEast1 is a BucketLocationConstraint enum value
-
Value:
"sa-east-1" -
const BucketLocationConstraintCnNorth1 = readonly
BucketLocationConstraintCnNorth1 is a BucketLocationConstraint enum value
-
Value:
"cn-north-1" -
const BucketLocationConstraintAms03OnerateActive = readonly
BucketLocationConstraintAms03OnerateActive is a BucketLocationConstraint enum value
-
Value:
"ams03-onerate_active" -
const BucketLocationConstraintChe01OnerateActive = readonly
BucketLocationConstraintChe01OnerateActive is a BucketLocationConstraint enum value
-
Value:
"che01-onerate_active" -
const BucketLocationConstraintMil01OnerateActive = readonly
BucketLocationConstraintMil01OnerateActive is a BucketLocationConstraint enum value
-
Value:
"mil01-onerate_active" -
const BucketLocationConstraintMon01OnerateActive = readonly
BucketLocationConstraintMon01OnerateActive is a BucketLocationConstraint enum value
-
Value:
"mon01-onerate_active" -
const BucketLocationConstraintPar01OnerateActive = readonly
BucketLocationConstraintPar01OnerateActive is a BucketLocationConstraint enum value
-
Value:
"par01-onerate_active" -
const BucketLocationConstraintSjc04OnerateActive = readonly
BucketLocationConstraintSjc04OnerateActive is a BucketLocationConstraint enum value
-
Value:
"sjc04-onerate_active" -
const BucketLocationConstraintSng01OnerateActive = readonly
BucketLocationConstraintSng01OnerateActive is a BucketLocationConstraint enum value
-
Value:
"sng01-onerate_active" -
const BucketLogsPermissionFullControl = readonly
BucketLogsPermissionFullControl is a BucketLogsPermission enum value
-
Value:
"FULL_CONTROL" -
const BucketLogsPermissionRead = readonly
BucketLogsPermissionRead is a BucketLogsPermission enum value
-
Value:
"READ" -
const BucketLogsPermissionWrite = readonly
BucketLogsPermissionWrite is a BucketLogsPermission enum value
-
Value:
"WRITE" -
const BucketProtectionStatusRetention = readonly
BucketProtectionStatusRetention is a BucketProtectionStatus enum value
-
Value:
"Retention" -
const BucketVersioningStatusEnabled = readonly
BucketVersioningStatusEnabled is a BucketVersioningStatus enum value
-
Value:
"Enabled" -
const BucketVersioningStatusSuspended = readonly
BucketVersioningStatusSuspended is a BucketVersioningStatus enum value
-
Value:
"Suspended" -
const DeleteMarkerReplicationStatusEnabled = readonly
DeleteMarkerReplicationStatusEnabled is a DeleteMarkerReplicationStatus enum value
-
Value:
"Enabled" -
const DeleteMarkerReplicationStatusDisabled = readonly
DeleteMarkerReplicationStatusDisabled is a DeleteMarkerReplicationStatus enum value
-
Value:
"Disabled" -
const EncodingTypeUrl = readonly
EncodingTypeUrl is a EncodingType enum value
-
Value:
"url" -
const ExpirationStatusEnabled = readonly
ExpirationStatusEnabled is a ExpirationStatus enum value
-
Value:
"Enabled" -
const ExpirationStatusDisabled = readonly
ExpirationStatusDisabled is a ExpirationStatus enum value
-
Value:
"Disabled" -
const IbmProtectionManagementStateActive = readonly
IbmProtectionManagementStateActive is a IbmProtectionManagementState enum value
-
Value:
"active" -
const MFADeleteEnabled = readonly
MFADeleteEnabled is a MFADelete enum value
-
Value:
"Enabled" -
const MFADeleteDisabled = readonly
MFADeleteDisabled is a MFADelete enum value
-
Value:
"Disabled" -
const MFADeleteStatusEnabled = readonly
MFADeleteStatusEnabled is a MFADeleteStatus enum value
-
Value:
"Enabled" -
const MFADeleteStatusDisabled = readonly
MFADeleteStatusDisabled is a MFADeleteStatus enum value
-
Value:
"Disabled" -
const MetadataDirectiveCopy = readonly
MetadataDirectiveCopy is a MetadataDirective enum value
-
Value:
"COPY" -
const MetadataDirectiveReplace = readonly
MetadataDirectiveReplace is a MetadataDirective enum value
-
Value:
"REPLACE" -
const ObjectCannedACLPrivate = readonly
ObjectCannedACLPrivate is a ObjectCannedACL enum value
-
Value:
"private" -
const ObjectCannedACLPublicRead = readonly
ObjectCannedACLPublicRead is a ObjectCannedACL enum value
-
Value:
"public-read" -
const ObjectCannedACLPublicReadWrite = readonly
ObjectCannedACLPublicReadWrite is a ObjectCannedACL enum value
-
Value:
"public-read-write" -
const ObjectCannedACLAuthenticatedRead = readonly
ObjectCannedACLAuthenticatedRead is a ObjectCannedACL enum value
-
Value:
"authenticated-read" -
const ObjectCannedACLAwsExecRead = readonly
ObjectCannedACLAwsExecRead is a ObjectCannedACL enum value
-
Value:
"aws-exec-read" -
const ObjectCannedACLBucketOwnerRead = readonly
ObjectCannedACLBucketOwnerRead is a ObjectCannedACL enum value
-
Value:
"bucket-owner-read" -
const ObjectCannedACLBucketOwnerFullControl = readonly
ObjectCannedACLBucketOwnerFullControl is a ObjectCannedACL enum value
-
Value:
"bucket-owner-full-control" -
const ObjectLockEnabledEnabled = readonly
ObjectLockEnabledEnabled is a ObjectLockEnabled enum value
-
Value:
"Enabled" -
const ObjectLockLegalHoldStatusOn = readonly
ObjectLockLegalHoldStatusOn is a ObjectLockLegalHoldStatus enum value
-
Value:
"ON" -
const ObjectLockLegalHoldStatusOff = readonly
ObjectLockLegalHoldStatusOff is a ObjectLockLegalHoldStatus enum value
-
Value:
"OFF" -
const ObjectLockModeGovernance = readonly
ObjectLockModeGovernance is a ObjectLockMode enum value
-
Value:
"GOVERNANCE" -
const ObjectLockModeCompliance = readonly
ObjectLockModeCompliance is a ObjectLockMode enum value
-
Value:
"COMPLIANCE" -
const ObjectLockRetentionModeGovernance = readonly
ObjectLockRetentionModeGovernance is a ObjectLockRetentionMode enum value
-
Value:
"GOVERNANCE" -
const ObjectLockRetentionModeCompliance = readonly
ObjectLockRetentionModeCompliance is a ObjectLockRetentionMode enum value
-
Value:
"COMPLIANCE" -
const ObjectStorageClassStandard = readonly
ObjectStorageClassStandard is a ObjectStorageClass enum value
-
Value:
"STANDARD" -
const ObjectStorageClassReducedRedundancy = readonly
ObjectStorageClassReducedRedundancy is a ObjectStorageClass enum value
-
Value:
"REDUCED_REDUNDANCY" -
const ObjectStorageClassGlacier = readonly
ObjectStorageClassGlacier is a ObjectStorageClass enum value
-
Value:
"GLACIER" -
const ObjectStorageClassAccelerated = readonly
ObjectStorageClassAccelerated is a ObjectStorageClass enum value
-
Value:
"ACCELERATED" -
const ObjectStorageClassStandardIa = readonly
ObjectStorageClassStandardIa is a ObjectStorageClass enum value
-
Value:
"STANDARD_IA" -
const ObjectStorageClassOnezoneIa = readonly
ObjectStorageClassOnezoneIa is a ObjectStorageClass enum value
-
Value:
"ONEZONE_IA" -
const ObjectStorageClassIntelligentTiering = readonly
ObjectStorageClassIntelligentTiering is a ObjectStorageClass enum value
-
Value:
"INTELLIGENT_TIERING" -
const ObjectStorageClassDeepArchive = readonly
ObjectStorageClassDeepArchive is a ObjectStorageClass enum value
-
Value:
"DEEP_ARCHIVE" -
const ObjectVersionStorageClassStandard = readonly
ObjectVersionStorageClassStandard is a ObjectVersionStorageClass enum value
-
Value:
"STANDARD" -
const PermissionFullControl = readonly
PermissionFullControl is a Permission enum value
-
Value:
"FULL_CONTROL" -
const PermissionWrite = readonly
PermissionWrite is a Permission enum value
-
Value:
"WRITE" -
const PermissionWriteAcp = readonly
PermissionWriteAcp is a Permission enum value
-
Value:
"WRITE_ACP" -
const PermissionRead = readonly
PermissionRead is a Permission enum value
-
Value:
"READ" -
const PermissionReadAcp = readonly
PermissionReadAcp is a Permission enum value
-
Value:
"READ_ACP" -
const ProtocolHttp = readonly
ProtocolHttp is a Protocol enum value
-
Value:
"http" -
const ProtocolHttps = readonly
ProtocolHttps is a Protocol enum value
-
Value:
"https" -
const ReplicationRuleStatusEnabled = readonly
ReplicationRuleStatusEnabled is a ReplicationRuleStatus enum value
-
Value:
"Enabled" -
const ReplicationRuleStatusDisabled = readonly
ReplicationRuleStatusDisabled is a ReplicationRuleStatus enum value
-
Value:
"Disabled" -
const ReplicationStatusComplete = readonly
ReplicationStatusComplete is a ReplicationStatus enum value
-
Value:
"COMPLETE" -
const ReplicationStatusPending = readonly
ReplicationStatusPending is a ReplicationStatus enum value
-
Value:
"PENDING" -
const ReplicationStatusFailed = readonly
ReplicationStatusFailed is a ReplicationStatus enum value
-
Value:
"FAILED" -
const ReplicationStatusReplica = readonly
ReplicationStatusReplica is a ReplicationStatus enum value
-
Value:
"REPLICA" -
const RequestChargedRequester = readonly
RequestChargedRequester is a RequestCharged enum value
-
Value:
"requester" -
const RequestPayerRequester = readonly
RequestPayerRequester is a RequestPayer enum value
-
Value:
"requester" -
const RetentionDirectiveCopy = readonly
RetentionDirectiveCopy is a RetentionDirective enum value
-
Value:
"COPY" -
const RetentionDirectiveReplace = readonly
RetentionDirectiveReplace is a RetentionDirective enum value
-
Value:
"REPLACE" -
const ServerSideEncryptionAes256 = readonly
ServerSideEncryptionAes256 is a ServerSideEncryption enum value
-
Value:
"AES256" -
const ServerSideEncryptionAwsKms = readonly
ServerSideEncryptionAwsKms is a ServerSideEncryption enum value
-
Value:
"aws:kms" -
const StorageClassStandard = readonly
StorageClassStandard is a StorageClass enum value
-
Value:
"STANDARD" -
const StorageClassReducedRedundancy = readonly
StorageClassReducedRedundancy is a StorageClass enum value
-
Value:
"REDUCED_REDUNDANCY" -
const StorageClassStandardIa = readonly
StorageClassStandardIa is a StorageClass enum value
-
Value:
"STANDARD_IA" -
const StorageClassOnezoneIa = readonly
StorageClassOnezoneIa is a StorageClass enum value
-
Value:
"ONEZONE_IA" -
const StorageClassIntelligentTiering = readonly
StorageClassIntelligentTiering is a StorageClass enum value
-
Value:
"INTELLIGENT_TIERING" -
const StorageClassGlacier = readonly
StorageClassGlacier is a StorageClass enum value
-
Value:
"GLACIER" -
const StorageClassAccelerated = readonly
StorageClassAccelerated is a StorageClass enum value
-
Value:
"ACCELERATED" -
const StorageClassDeepArchive = readonly
StorageClassDeepArchive is a StorageClass enum value
-
Value:
"DEEP_ARCHIVE" -
const TaggingDirectiveCopy = readonly
TaggingDirectiveCopy is a TaggingDirective enum value
-
Value:
"COPY" -
const TaggingDirectiveReplace = readonly
TaggingDirectiveReplace is a TaggingDirective enum value
-
Value:
"REPLACE" -
const TierAccelerated = readonly
TierAccelerated is a Tier enum value
-
Value:
"Accelerated" -
const TierStandard = readonly
TierStandard is a Tier enum value
-
Value:
"Standard" -
const TierBulk = readonly
TierBulk is a Tier enum value
-
Value:
"Bulk" -
const TierExpedited = readonly
TierExpedited is a Tier enum value
-
Value:
"Expedited" -
const TransitionStorageClassGlacier = readonly
TransitionStorageClassGlacier is a TransitionStorageClass enum value
-
Value:
"GLACIER" -
const TransitionStorageClassAccelerated = readonly
TransitionStorageClassAccelerated is a TransitionStorageClass enum value
-
Value:
"ACCELERATED" -
const TransitionStorageClassStandardIa = readonly
TransitionStorageClassStandardIa is a TransitionStorageClass enum value
-
Value:
"STANDARD_IA" -
const TransitionStorageClassOnezoneIa = readonly
TransitionStorageClassOnezoneIa is a TransitionStorageClass enum value
-
Value:
"ONEZONE_IA" -
const TransitionStorageClassIntelligentTiering = readonly
TransitionStorageClassIntelligentTiering is a TransitionStorageClass enum value
-
Value:
"INTELLIGENT_TIERING" -
const TransitionStorageClassDeepArchive = readonly
TransitionStorageClassDeepArchive is a TransitionStorageClass enum value
-
Value:
"DEEP_ARCHIVE" -
const TypeCanonicalUser = readonly
TypeCanonicalUser is a Type enum value
-
Value:
"CanonicalUser" -
const TypeAmazonCustomerByEmail = readonly
TypeAmazonCustomerByEmail is a Type enum value
-
Value:
"AmazonCustomerByEmail" -
const TypeGroup = readonly
TypeGroup is a Type enum value
-
Value:
"Group" -
const ErrCodeBucketAlreadyExists = readonly
ErrCodeBucketAlreadyExists for service response error code “BucketAlreadyExists”.
The requested bucket name is not available. The bucket namespace is shared by all users of the system. Select a different name and try again.
-
Value:
"BucketAlreadyExists" -
const ErrCodeBucketAlreadyOwnedByYou = readonly
ErrCodeBucketAlreadyOwnedByYou for service response error code “BucketAlreadyOwnedByYou”.
The bucket you tried to create already exists, and you own it. Amazon S3 returns this error in all AWS Regions except in the North Virginia Region. For legacy compatibility, if you re-create an existing bucket that you already own in the North Virginia Region, Amazon S3 returns 200 OK and resets the bucket access control lists (ACLs).
-
Value:
"BucketAlreadyOwnedByYou" -
const ErrCodeInvalidObjectState = readonly
ErrCodeInvalidObjectState for service response error code “InvalidObjectState”.
Object is archived and inaccessible until restored.
-
Value:
"InvalidObjectState" -
const ErrCodeNoSuchBucket = readonly
ErrCodeNoSuchBucket for service response error code “NoSuchBucket”.
The specified bucket does not exist.
-
Value:
"NoSuchBucket" -
const ErrCodeNoSuchKey = readonly
ErrCodeNoSuchKey for service response error code “NoSuchKey”.
The specified key does not exist.
-
Value:
"NoSuchKey" -
const ErrCodeNoSuchUpload = readonly
ErrCodeNoSuchUpload for service response error code “NoSuchUpload”.
The specified multipart upload does not exist.
-
Value:
"NoSuchUpload" -
const ErrCodeObjectAlreadyInActiveTierError = readonly
ErrCodeObjectAlreadyInActiveTierError for service response error code “ObjectAlreadyInActiveTierError”.
This action is not allowed against this storage tier.
-
Value:
"ObjectAlreadyInActiveTierError" -
const ErrCodeObjectNotInActiveTierError = readonly
ErrCodeObjectNotInActiveTierError for service response error code “ObjectNotInActiveTierError”.
The source object of the COPY action is not in the active tier and is only stored in Amazon S3 Glacier.
-
Value:
"ObjectNotInActiveTierError" -
const ServiceName = readonly
-
Value:
"s3" // Name of service. -
const EndpointsID = readonly
-
Value:
ServiceName // ID to lookup a service endpoint with. -
const ServiceID = readonly
-
Value:
Variables
-
var NormalizeBucketLocationHandler = writable
NormalizeBucketLocationHandler is a request handler which will update the GetBucketLocation’s result LocationConstraint value to always be a region ID.
Replaces empty string with “us-east-1”, and “EU” with “eu-west-1”.
See docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html for more information on the values that can be returned.
req, result := svc.GetBucketLocationRequest(&s3.GetBucketLocationInput{ Bucket: aws.String(bucket), }) req.Handlers.Unmarshal.PushBackNamed(NormalizeBucketLocationHandler) err := req.Send() -
Value:
request.NamedHandler{ Name: "awssdk.s3.NormalizeBucketLocation", Fn: func(req *request.Request) { if req.Error != nil { return } out := req.Data.(*GetBucketLocationOutput) loc := NormalizeBucketLocation(aws.StringValue(out.LocationConstraint)) out.LocationConstraint = aws.String(loc) }, }
Type Summary collapse
- AddLegalHoldOutput struct
- DeleteBucketCorsOutput struct
- DeleteBucketLifecycleOutput struct
- DeleteBucketOutput struct
- DeleteBucketReplicationOutput struct
- DeleteBucketWebsiteOutput struct
- DeleteLegalHoldOutput struct
- DeletePublicAccessBlockOutput struct
- ExtendObjectRetentionOutput struct
- PutBucketAclOutput struct
- PutBucketCorsOutput struct
- PutBucketLifecycleConfigurationOutput struct
- PutBucketLoggingOutput struct
- PutBucketProtectionConfigurationOutput struct
- PutBucketReplicationOutput struct
- PutBucketReplicationReattemptOutput struct
- PutBucketVersioningOutput struct
- PutBucketWebsiteOutput struct
- PutPublicAccessBlockOutput struct
- RestoreObjectOutput struct
Interface Summary collapse
-
RequestFailure
interface
A RequestFailure provides access to the S3 Request ID and Host ID values returned from API operation errors.
Function Summary collapse
-
func BucketCannedACL_Values() []string
BucketCannedACL_Values returns all elements of the BucketCannedACL enum.
-
func BucketLocationConstraint_Values() []string
BucketLocationConstraint_Values returns all elements of the BucketLocationConstraint enum.
-
func BucketLogsPermission_Values() []string
BucketLogsPermission_Values returns all elements of the BucketLogsPermission enum.
-
func BucketProtectionStatus_Values() []string
BucketProtectionStatus_Values returns all elements of the BucketProtectionStatus enum.
-
func BucketVersioningStatus_Values() []string
BucketVersioningStatus_Values returns all elements of the BucketVersioningStatus enum.
-
func DeleteMarkerReplicationStatus_Values() []string
DeleteMarkerReplicationStatus_Values returns all elements of the DeleteMarkerReplicationStatus enum.
-
func EncodingType_Values() []string
EncodingType_Values returns all elements of the EncodingType enum.
-
func ExpirationStatus_Values() []string
ExpirationStatus_Values returns all elements of the ExpirationStatus enum.
-
func IbmProtectionManagementState_Values() []string
IbmProtectionManagementState_Values returns all elements of the IbmProtectionManagementState enum.
-
func MetadataDirective_Values() []string
MetadataDirective_Values returns all elements of the MetadataDirective enum.
-
func MFADelete_Values() []string
MFADelete_Values returns all elements of the MFADelete enum.
-
func MFADeleteStatus_Values() []string
MFADeleteStatus_Values returns all elements of the MFADeleteStatus enum.
-
func NormalizeBucketLocation(loc string) string
NormalizeBucketLocation is a utility function which will update the passed in value to always be a region ID.
-
func ObjectCannedACL_Values() []string
ObjectCannedACL_Values returns all elements of the ObjectCannedACL enum.
-
func ObjectLockEnabled_Values() []string
ObjectLockEnabled_Values returns all elements of the ObjectLockEnabled enum.
-
func ObjectLockLegalHoldStatus_Values() []string
ObjectLockLegalHoldStatus_Values returns all elements of the ObjectLockLegalHoldStatus enum.
-
func ObjectLockMode_Values() []string
ObjectLockMode_Values returns all elements of the ObjectLockMode enum.
-
func ObjectLockRetentionMode_Values() []string
ObjectLockRetentionMode_Values returns all elements of the ObjectLockRetentionMode enum.
-
func ObjectStorageClass_Values() []string
ObjectStorageClass_Values returns all elements of the ObjectStorageClass enum.
-
func ObjectVersionStorageClass_Values() []string
ObjectVersionStorageClass_Values returns all elements of the ObjectVersionStorageClass enum.
-
func Permission_Values() []string
Permission_Values returns all elements of the Permission enum.
-
func Protocol_Values() []string
Protocol_Values returns all elements of the Protocol enum.
-
func ReplicationRuleStatus_Values() []string
ReplicationRuleStatus_Values returns all elements of the ReplicationRuleStatus enum.
-
func ReplicationStatus_Values() []string
ReplicationStatus_Values returns all elements of the ReplicationStatus enum.
-
func RequestCharged_Values() []string
RequestCharged_Values returns all elements of the RequestCharged enum.
-
func RequestPayer_Values() []string
RequestPayer_Values returns all elements of the RequestPayer enum.
-
func RetentionDirective_Values() []string
RetentionDirective_Values returns all elements of the RetentionDirective enum.
-
func ServerSideEncryption_Values() []string
ServerSideEncryption_Values returns all elements of the ServerSideEncryption enum.
-
func StorageClass_Values() []string
StorageClass_Values returns all elements of the StorageClass enum.
-
func TaggingDirective_Values() []string
TaggingDirective_Values returns all elements of the TaggingDirective enum.
-
func Tier_Values() []string
Tier_Values returns all elements of the Tier enum.
-
func TransitionStorageClass_Values() []string
TransitionStorageClass_Values returns all elements of the TransitionStorageClass enum.
-
func Type_Values() []string
Type_Values returns all elements of the Type enum.
-
func WithNormalizeBucketLocation(r *request.Request)
WithNormalizeBucketLocation is a request option which will update the GetBucketLocation’s result LocationConstraint value to always be a region ID.
Type Details
AddLegalHoldOutput struct
DeleteBucketCorsOutput struct
DeleteBucketLifecycleOutput struct
DeleteBucketOutput struct
DeleteBucketReplicationOutput struct
DeleteBucketWebsiteOutput struct
DeleteLegalHoldOutput struct
DeletePublicAccessBlockOutput struct
ExtendObjectRetentionOutput struct
PutBucketAclOutput struct
PutBucketCorsOutput struct
PutBucketLifecycleConfigurationOutput struct
PutBucketLoggingOutput struct
PutBucketProtectionConfigurationOutput struct
PutBucketReplicationOutput struct
PutBucketReplicationReattemptOutput struct
PutBucketVersioningOutput struct
PutBucketWebsiteOutput struct
PutPublicAccessBlockOutput struct
RestoreObjectOutput struct
Function Details
func BucketCannedACL_Values() []string
BucketCannedACL_Values returns all elements of the BucketCannedACL enum
23698 23699 23700 23701 23702 23703 23704 23705 |
// File 'service/s3/api.go', line 23698
|
func BucketLocationConstraint_Values() []string
BucketLocationConstraint_Values returns all elements of the BucketLocationConstraint enum
23785 23786 23787 23788 23789 23790 23791 23792 23793 23794 23795 23796 23797 23798 23799 23800 23801 23802 23803 23804 23805 23806 23807 23808 23809 23810 23811 23812 23813 |
// File 'service/s3/api.go', line 23785
|
func BucketLogsPermission_Values() []string
BucketLogsPermission_Values returns all elements of the BucketLogsPermission enum
23827 23828 23829 23830 23831 23832 23833 |
// File 'service/s3/api.go', line 23827
|
func BucketProtectionStatus_Values() []string
BucketProtectionStatus_Values returns all elements of the BucketProtectionStatus enum
23841 23842 23843 23844 23845 |
// File 'service/s3/api.go', line 23841
|
func BucketVersioningStatus_Values() []string
BucketVersioningStatus_Values returns all elements of the BucketVersioningStatus enum
23856 23857 23858 23859 23860 23861 |
// File 'service/s3/api.go', line 23856
|
func DeleteMarkerReplicationStatus_Values() []string
DeleteMarkerReplicationStatus_Values returns all elements of the DeleteMarkerReplicationStatus enum
23872 23873 23874 23875 23876 23877 |
// File 'service/s3/api.go', line 23872
|
func EncodingType_Values() []string
EncodingType_Values returns all elements of the EncodingType enum
23891 23892 23893 23894 23895 |
// File 'service/s3/api.go', line 23891
|
func ExpirationStatus_Values() []string
ExpirationStatus_Values returns all elements of the ExpirationStatus enum
23906 23907 23908 23909 23910 23911 |
// File 'service/s3/api.go', line 23906
|
func IbmProtectionManagementState_Values() []string
IbmProtectionManagementState_Values returns all elements of the IbmProtectionManagementState enum
23919 23920 23921 23922 23923 |
// File 'service/s3/api.go', line 23919
|
func MetadataDirective_Values() []string
MetadataDirective_Values returns all elements of the MetadataDirective enum
23966 23967 23968 23969 23970 23971 |
// File 'service/s3/api.go', line 23966
|
func MFADelete_Values() []string
MFADelete_Values returns all elements of the MFADelete enum
23934 23935 23936 23937 23938 23939 |
// File 'service/s3/api.go', line 23934
|
func MFADeleteStatus_Values() []string
MFADeleteStatus_Values returns all elements of the MFADeleteStatus enum
23950 23951 23952 23953 23954 23955 |
// File 'service/s3/api.go', line 23950
|
func NormalizeBucketLocation(loc string) string
NormalizeBucketLocation is a utility function which will update the passed in value to always be a region ID. Generally this would be used with GetBucketLocation API operation.
Replaces empty string with “us-east-1”, and “EU” with “eu-west-1”.
See docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html for more information on the values that can be returned.
21 22 23 24 25 26 27 28 29 30 |
// File 'service/s3/bucket_location.go', line 21
|
func ObjectCannedACL_Values() []string
ObjectCannedACL_Values returns all elements of the ObjectCannedACL enum
23997 23998 23999 24000 24001 24002 24003 24004 24005 24006 24007 |
// File 'service/s3/api.go', line 23997
|
func ObjectLockEnabled_Values() []string
ObjectLockEnabled_Values returns all elements of the ObjectLockEnabled enum
24015 24016 24017 24018 24019 |
// File 'service/s3/api.go', line 24015
|
func ObjectLockLegalHoldStatus_Values() []string
ObjectLockLegalHoldStatus_Values returns all elements of the ObjectLockLegalHoldStatus enum
24030 24031 24032 24033 24034 24035 |
// File 'service/s3/api.go', line 24030
|
func ObjectLockMode_Values() []string
ObjectLockMode_Values returns all elements of the ObjectLockMode enum
24046 24047 24048 24049 24050 24051 |
// File 'service/s3/api.go', line 24046
|
func ObjectLockRetentionMode_Values() []string
ObjectLockRetentionMode_Values returns all elements of the ObjectLockRetentionMode enum
24062 24063 24064 24065 24066 24067 |
// File 'service/s3/api.go', line 24062
|
func ObjectStorageClass_Values() []string
ObjectStorageClass_Values returns all elements of the ObjectStorageClass enum
24096 24097 24098 24099 24100 24101 24102 24103 24104 24105 24106 24107 |
// File 'service/s3/api.go', line 24096
|
func ObjectVersionStorageClass_Values() []string
ObjectVersionStorageClass_Values returns all elements of the ObjectVersionStorageClass enum
24115 24116 24117 24118 24119 |
// File 'service/s3/api.go', line 24115
|
func Permission_Values() []string
Permission_Values returns all elements of the Permission enum
24139 24140 24141 24142 24143 24144 24145 24146 24147 |
// File 'service/s3/api.go', line 24139
|
func Protocol_Values() []string
Protocol_Values returns all elements of the Protocol enum
24158 24159 24160 24161 24162 24163 |
// File 'service/s3/api.go', line 24158
|
func ReplicationRuleStatus_Values() []string
ReplicationRuleStatus_Values returns all elements of the ReplicationRuleStatus enum
24174 24175 24176 24177 24178 24179 |
// File 'service/s3/api.go', line 24174
|
func ReplicationStatus_Values() []string
ReplicationStatus_Values returns all elements of the ReplicationStatus enum
24196 24197 24198 24199 24200 24201 24202 24203 |
// File 'service/s3/api.go', line 24196
|
func RequestCharged_Values() []string
RequestCharged_Values returns all elements of the RequestCharged enum
24213 24214 24215 24216 24217 |
// File 'service/s3/api.go', line 24213
|
func RequestPayer_Values() []string
RequestPayer_Values returns all elements of the RequestPayer enum
24232 24233 24234 24235 24236 |
// File 'service/s3/api.go', line 24232
|
func RetentionDirective_Values() []string
RetentionDirective_Values returns all elements of the RetentionDirective enum
24247 24248 24249 24250 24251 24252 |
// File 'service/s3/api.go', line 24247
|
func ServerSideEncryption_Values() []string
ServerSideEncryption_Values returns all elements of the ServerSideEncryption enum
24263 24264 24265 24266 24267 24268 |
// File 'service/s3/api.go', line 24263
|
func StorageClass_Values() []string
StorageClass_Values returns all elements of the StorageClass enum
24297 24298 24299 24300 24301 24302 24303 24304 24305 24306 24307 24308 |
// File 'service/s3/api.go', line 24297
|
func TaggingDirective_Values() []string
TaggingDirective_Values returns all elements of the TaggingDirective enum
24319 24320 24321 24322 24323 24324 |
// File 'service/s3/api.go', line 24319
|
func Tier_Values() []string
Tier_Values returns all elements of the Tier enum
24341 24342 24343 24344 24345 24346 24347 24348 |
// File 'service/s3/api.go', line 24341
|
func TransitionStorageClass_Values() []string
TransitionStorageClass_Values returns all elements of the TransitionStorageClass enum
24371 24372 24373 24374 24375 24376 24377 24378 24379 24380 |
// File 'service/s3/api.go', line 24371
|
func Type_Values() []string
Type_Values returns all elements of the Type enum
24394 24395 24396 24397 24398 24399 24400 |
// File 'service/s3/api.go', line 24394
|
func WithNormalizeBucketLocation(r *request.Request)
WithNormalizeBucketLocation is a request option which will update the GetBucketLocation’s result LocationConstraint value to always be a region ID.
Replaces empty string with “us-east-1”, and “EU” with “eu-west-1”.
See docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html for more information on the values that can be returned.
result, err := svc.GetBucketLocationWithContext(ctx,
&s3.GetBucketLocationInput{
Bucket: aws.String(bucket),
},
s3.WithNormalizeBucketLocation,
)
72 73 74 |
// File 'service/s3/bucket_location.go', line 72
|