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
- 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
PutBucketVersioningOutput struct
PutBucketWebsiteOutput struct
PutPublicAccessBlockOutput struct
RestoreObjectOutput struct
Function Details
func BucketCannedACL_Values() []string
BucketCannedACL_Values returns all elements of the BucketCannedACL enum
23166 23167 23168 23169 23170 23171 23172 23173 |
// File 'service/s3/api.go', line 23166
|
func BucketLocationConstraint_Values() []string
BucketLocationConstraint_Values returns all elements of the BucketLocationConstraint enum
23253 23254 23255 23256 23257 23258 23259 23260 23261 23262 23263 23264 23265 23266 23267 23268 23269 23270 23271 23272 23273 23274 23275 23276 23277 23278 23279 23280 23281 |
// File 'service/s3/api.go', line 23253
|
func BucketLogsPermission_Values() []string
BucketLogsPermission_Values returns all elements of the BucketLogsPermission enum
23295 23296 23297 23298 23299 23300 23301 |
// File 'service/s3/api.go', line 23295
|
func BucketProtectionStatus_Values() []string
BucketProtectionStatus_Values returns all elements of the BucketProtectionStatus enum
23309 23310 23311 23312 23313 |
// File 'service/s3/api.go', line 23309
|
func BucketVersioningStatus_Values() []string
BucketVersioningStatus_Values returns all elements of the BucketVersioningStatus enum
23324 23325 23326 23327 23328 23329 |
// File 'service/s3/api.go', line 23324
|
func DeleteMarkerReplicationStatus_Values() []string
DeleteMarkerReplicationStatus_Values returns all elements of the DeleteMarkerReplicationStatus enum
23340 23341 23342 23343 23344 23345 |
// File 'service/s3/api.go', line 23340
|
func EncodingType_Values() []string
EncodingType_Values returns all elements of the EncodingType enum
23359 23360 23361 23362 23363 |
// File 'service/s3/api.go', line 23359
|
func ExpirationStatus_Values() []string
ExpirationStatus_Values returns all elements of the ExpirationStatus enum
23374 23375 23376 23377 23378 23379 |
// File 'service/s3/api.go', line 23374
|
func IbmProtectionManagementState_Values() []string
IbmProtectionManagementState_Values returns all elements of the IbmProtectionManagementState enum
23387 23388 23389 23390 23391 |
// File 'service/s3/api.go', line 23387
|
func MetadataDirective_Values() []string
MetadataDirective_Values returns all elements of the MetadataDirective enum
23434 23435 23436 23437 23438 23439 |
// File 'service/s3/api.go', line 23434
|
func MFADelete_Values() []string
MFADelete_Values returns all elements of the MFADelete enum
23402 23403 23404 23405 23406 23407 |
// File 'service/s3/api.go', line 23402
|
func MFADeleteStatus_Values() []string
MFADeleteStatus_Values returns all elements of the MFADeleteStatus enum
23418 23419 23420 23421 23422 23423 |
// File 'service/s3/api.go', line 23418
|
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
23465 23466 23467 23468 23469 23470 23471 23472 23473 23474 23475 |
// File 'service/s3/api.go', line 23465
|
func ObjectLockEnabled_Values() []string
ObjectLockEnabled_Values returns all elements of the ObjectLockEnabled enum
23483 23484 23485 23486 23487 |
// File 'service/s3/api.go', line 23483
|
func ObjectLockLegalHoldStatus_Values() []string
ObjectLockLegalHoldStatus_Values returns all elements of the ObjectLockLegalHoldStatus enum
23498 23499 23500 23501 23502 23503 |
// File 'service/s3/api.go', line 23498
|
func ObjectLockMode_Values() []string
ObjectLockMode_Values returns all elements of the ObjectLockMode enum
23514 23515 23516 23517 23518 23519 |
// File 'service/s3/api.go', line 23514
|
func ObjectLockRetentionMode_Values() []string
ObjectLockRetentionMode_Values returns all elements of the ObjectLockRetentionMode enum
23530 23531 23532 23533 23534 23535 |
// File 'service/s3/api.go', line 23530
|
func ObjectStorageClass_Values() []string
ObjectStorageClass_Values returns all elements of the ObjectStorageClass enum
23564 23565 23566 23567 23568 23569 23570 23571 23572 23573 23574 23575 |
// File 'service/s3/api.go', line 23564
|
func ObjectVersionStorageClass_Values() []string
ObjectVersionStorageClass_Values returns all elements of the ObjectVersionStorageClass enum
23583 23584 23585 23586 23587 |
// File 'service/s3/api.go', line 23583
|
func Permission_Values() []string
Permission_Values returns all elements of the Permission enum
23607 23608 23609 23610 23611 23612 23613 23614 23615 |
// File 'service/s3/api.go', line 23607
|
func Protocol_Values() []string
Protocol_Values returns all elements of the Protocol enum
23626 23627 23628 23629 23630 23631 |
// File 'service/s3/api.go', line 23626
|
func ReplicationRuleStatus_Values() []string
ReplicationRuleStatus_Values returns all elements of the ReplicationRuleStatus enum
23642 23643 23644 23645 23646 23647 |
// File 'service/s3/api.go', line 23642
|
func ReplicationStatus_Values() []string
ReplicationStatus_Values returns all elements of the ReplicationStatus enum
23664 23665 23666 23667 23668 23669 23670 23671 |
// File 'service/s3/api.go', line 23664
|
func RequestCharged_Values() []string
RequestCharged_Values returns all elements of the RequestCharged enum
23681 23682 23683 23684 23685 |
// File 'service/s3/api.go', line 23681
|
func RequestPayer_Values() []string
RequestPayer_Values returns all elements of the RequestPayer enum
23700 23701 23702 23703 23704 |
// File 'service/s3/api.go', line 23700
|
func RetentionDirective_Values() []string
RetentionDirective_Values returns all elements of the RetentionDirective enum
23715 23716 23717 23718 23719 23720 |
// File 'service/s3/api.go', line 23715
|
func ServerSideEncryption_Values() []string
ServerSideEncryption_Values returns all elements of the ServerSideEncryption enum
23731 23732 23733 23734 23735 23736 |
// File 'service/s3/api.go', line 23731
|
func StorageClass_Values() []string
StorageClass_Values returns all elements of the StorageClass enum
23765 23766 23767 23768 23769 23770 23771 23772 23773 23774 23775 23776 |
// File 'service/s3/api.go', line 23765
|
func TaggingDirective_Values() []string
TaggingDirective_Values returns all elements of the TaggingDirective enum
23787 23788 23789 23790 23791 23792 |
// File 'service/s3/api.go', line 23787
|
func Tier_Values() []string
Tier_Values returns all elements of the Tier enum
23809 23810 23811 23812 23813 23814 23815 23816 |
// File 'service/s3/api.go', line 23809
|
func TransitionStorageClass_Values() []string
TransitionStorageClass_Values returns all elements of the TransitionStorageClass enum
23839 23840 23841 23842 23843 23844 23845 23846 23847 23848 |
// File 'service/s3/api.go', line 23839
|
func Type_Values() []string
Type_Values returns all elements of the Type enum
23862 23863 23864 23865 23866 23867 23868 |
// File 'service/s3/api.go', line 23862
|
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
|