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
23694 23695 23696 23697 23698 23699 23700 23701 |
// File 'service/s3/api.go', line 23694
|
func BucketLocationConstraint_Values() []string
BucketLocationConstraint_Values returns all elements of the BucketLocationConstraint enum
23781 23782 23783 23784 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 |
// File 'service/s3/api.go', line 23781
|
func BucketLogsPermission_Values() []string
BucketLogsPermission_Values returns all elements of the BucketLogsPermission enum
23823 23824 23825 23826 23827 23828 23829 |
// File 'service/s3/api.go', line 23823
|
func BucketProtectionStatus_Values() []string
BucketProtectionStatus_Values returns all elements of the BucketProtectionStatus enum
23837 23838 23839 23840 23841 |
// File 'service/s3/api.go', line 23837
|
func BucketVersioningStatus_Values() []string
BucketVersioningStatus_Values returns all elements of the BucketVersioningStatus enum
23852 23853 23854 23855 23856 23857 |
// File 'service/s3/api.go', line 23852
|
func DeleteMarkerReplicationStatus_Values() []string
DeleteMarkerReplicationStatus_Values returns all elements of the DeleteMarkerReplicationStatus enum
23868 23869 23870 23871 23872 23873 |
// File 'service/s3/api.go', line 23868
|
func EncodingType_Values() []string
EncodingType_Values returns all elements of the EncodingType enum
23887 23888 23889 23890 23891 |
// File 'service/s3/api.go', line 23887
|
func ExpirationStatus_Values() []string
ExpirationStatus_Values returns all elements of the ExpirationStatus enum
23902 23903 23904 23905 23906 23907 |
// File 'service/s3/api.go', line 23902
|
func IbmProtectionManagementState_Values() []string
IbmProtectionManagementState_Values returns all elements of the IbmProtectionManagementState enum
23915 23916 23917 23918 23919 |
// File 'service/s3/api.go', line 23915
|
func MetadataDirective_Values() []string
MetadataDirective_Values returns all elements of the MetadataDirective enum
23962 23963 23964 23965 23966 23967 |
// File 'service/s3/api.go', line 23962
|
func MFADelete_Values() []string
MFADelete_Values returns all elements of the MFADelete enum
23930 23931 23932 23933 23934 23935 |
// File 'service/s3/api.go', line 23930
|
func MFADeleteStatus_Values() []string
MFADeleteStatus_Values returns all elements of the MFADeleteStatus enum
23946 23947 23948 23949 23950 23951 |
// File 'service/s3/api.go', line 23946
|
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
23993 23994 23995 23996 23997 23998 23999 24000 24001 24002 24003 |
// File 'service/s3/api.go', line 23993
|
func ObjectLockEnabled_Values() []string
ObjectLockEnabled_Values returns all elements of the ObjectLockEnabled enum
24011 24012 24013 24014 24015 |
// File 'service/s3/api.go', line 24011
|
func ObjectLockLegalHoldStatus_Values() []string
ObjectLockLegalHoldStatus_Values returns all elements of the ObjectLockLegalHoldStatus enum
24026 24027 24028 24029 24030 24031 |
// File 'service/s3/api.go', line 24026
|
func ObjectLockMode_Values() []string
ObjectLockMode_Values returns all elements of the ObjectLockMode enum
24042 24043 24044 24045 24046 24047 |
// File 'service/s3/api.go', line 24042
|
func ObjectLockRetentionMode_Values() []string
ObjectLockRetentionMode_Values returns all elements of the ObjectLockRetentionMode enum
24058 24059 24060 24061 24062 24063 |
// File 'service/s3/api.go', line 24058
|
func ObjectStorageClass_Values() []string
ObjectStorageClass_Values returns all elements of the ObjectStorageClass enum
24092 24093 24094 24095 24096 24097 24098 24099 24100 24101 24102 24103 |
// File 'service/s3/api.go', line 24092
|
func ObjectVersionStorageClass_Values() []string
ObjectVersionStorageClass_Values returns all elements of the ObjectVersionStorageClass enum
24111 24112 24113 24114 24115 |
// File 'service/s3/api.go', line 24111
|
func Permission_Values() []string
Permission_Values returns all elements of the Permission enum
24135 24136 24137 24138 24139 24140 24141 24142 24143 |
// File 'service/s3/api.go', line 24135
|
func Protocol_Values() []string
Protocol_Values returns all elements of the Protocol enum
24154 24155 24156 24157 24158 24159 |
// File 'service/s3/api.go', line 24154
|
func ReplicationRuleStatus_Values() []string
ReplicationRuleStatus_Values returns all elements of the ReplicationRuleStatus enum
24170 24171 24172 24173 24174 24175 |
// File 'service/s3/api.go', line 24170
|
func ReplicationStatus_Values() []string
ReplicationStatus_Values returns all elements of the ReplicationStatus enum
24192 24193 24194 24195 24196 24197 24198 24199 |
// File 'service/s3/api.go', line 24192
|
func RequestCharged_Values() []string
RequestCharged_Values returns all elements of the RequestCharged enum
24209 24210 24211 24212 24213 |
// File 'service/s3/api.go', line 24209
|
func RequestPayer_Values() []string
RequestPayer_Values returns all elements of the RequestPayer enum
24228 24229 24230 24231 24232 |
// File 'service/s3/api.go', line 24228
|
func RetentionDirective_Values() []string
RetentionDirective_Values returns all elements of the RetentionDirective enum
24243 24244 24245 24246 24247 24248 |
// File 'service/s3/api.go', line 24243
|
func ServerSideEncryption_Values() []string
ServerSideEncryption_Values returns all elements of the ServerSideEncryption enum
24259 24260 24261 24262 24263 24264 |
// File 'service/s3/api.go', line 24259
|
func StorageClass_Values() []string
StorageClass_Values returns all elements of the StorageClass enum
24293 24294 24295 24296 24297 24298 24299 24300 24301 24302 24303 24304 |
// File 'service/s3/api.go', line 24293
|
func TaggingDirective_Values() []string
TaggingDirective_Values returns all elements of the TaggingDirective enum
24315 24316 24317 24318 24319 24320 |
// File 'service/s3/api.go', line 24315
|
func Tier_Values() []string
Tier_Values returns all elements of the Tier enum
24337 24338 24339 24340 24341 24342 24343 24344 |
// File 'service/s3/api.go', line 24337
|
func TransitionStorageClass_Values() []string
TransitionStorageClass_Values returns all elements of the TransitionStorageClass enum
24367 24368 24369 24370 24371 24372 24373 24374 24375 24376 |
// File 'service/s3/api.go', line 24367
|
func Type_Values() []string
Type_Values returns all elements of the Type enum
24390 24391 24392 24393 24394 24395 24396 |
// File 'service/s3/api.go', line 24390
|
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
|