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
22929 22930 22931 22932 22933 22934 22935 22936 |
// File 'service/s3/api.go', line 22929
|
func BucketLocationConstraint_Values() []string
BucketLocationConstraint_Values returns all elements of the BucketLocationConstraint enum
23016 23017 23018 23019 23020 23021 23022 23023 23024 23025 23026 23027 23028 23029 23030 23031 23032 23033 23034 23035 23036 23037 23038 23039 23040 23041 23042 23043 23044 |
// File 'service/s3/api.go', line 23016
|
func BucketLogsPermission_Values() []string
BucketLogsPermission_Values returns all elements of the BucketLogsPermission enum
23058 23059 23060 23061 23062 23063 23064 |
// File 'service/s3/api.go', line 23058
|
func BucketProtectionStatus_Values() []string
BucketProtectionStatus_Values returns all elements of the BucketProtectionStatus enum
23072 23073 23074 23075 23076 |
// File 'service/s3/api.go', line 23072
|
func BucketVersioningStatus_Values() []string
BucketVersioningStatus_Values returns all elements of the BucketVersioningStatus enum
23087 23088 23089 23090 23091 23092 |
// File 'service/s3/api.go', line 23087
|
func DeleteMarkerReplicationStatus_Values() []string
DeleteMarkerReplicationStatus_Values returns all elements of the DeleteMarkerReplicationStatus enum
23103 23104 23105 23106 23107 23108 |
// File 'service/s3/api.go', line 23103
|
func EncodingType_Values() []string
EncodingType_Values returns all elements of the EncodingType enum
23122 23123 23124 23125 23126 |
// File 'service/s3/api.go', line 23122
|
func ExpirationStatus_Values() []string
ExpirationStatus_Values returns all elements of the ExpirationStatus enum
23137 23138 23139 23140 23141 23142 |
// File 'service/s3/api.go', line 23137
|
func IbmProtectionManagementState_Values() []string
IbmProtectionManagementState_Values returns all elements of the IbmProtectionManagementState enum
23150 23151 23152 23153 23154 |
// File 'service/s3/api.go', line 23150
|
func MetadataDirective_Values() []string
MetadataDirective_Values returns all elements of the MetadataDirective enum
23197 23198 23199 23200 23201 23202 |
// File 'service/s3/api.go', line 23197
|
func MFADelete_Values() []string
MFADelete_Values returns all elements of the MFADelete enum
23165 23166 23167 23168 23169 23170 |
// File 'service/s3/api.go', line 23165
|
func MFADeleteStatus_Values() []string
MFADeleteStatus_Values returns all elements of the MFADeleteStatus enum
23181 23182 23183 23184 23185 23186 |
// File 'service/s3/api.go', line 23181
|
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
23228 23229 23230 23231 23232 23233 23234 23235 23236 23237 23238 |
// File 'service/s3/api.go', line 23228
|
func ObjectLockEnabled_Values() []string
ObjectLockEnabled_Values returns all elements of the ObjectLockEnabled enum
23246 23247 23248 23249 23250 |
// File 'service/s3/api.go', line 23246
|
func ObjectLockLegalHoldStatus_Values() []string
ObjectLockLegalHoldStatus_Values returns all elements of the ObjectLockLegalHoldStatus enum
23261 23262 23263 23264 23265 23266 |
// File 'service/s3/api.go', line 23261
|
func ObjectLockMode_Values() []string
ObjectLockMode_Values returns all elements of the ObjectLockMode enum
23277 23278 23279 23280 23281 23282 |
// File 'service/s3/api.go', line 23277
|
func ObjectLockRetentionMode_Values() []string
ObjectLockRetentionMode_Values returns all elements of the ObjectLockRetentionMode enum
23293 23294 23295 23296 23297 23298 |
// File 'service/s3/api.go', line 23293
|
func ObjectStorageClass_Values() []string
ObjectStorageClass_Values returns all elements of the ObjectStorageClass enum
23327 23328 23329 23330 23331 23332 23333 23334 23335 23336 23337 23338 |
// File 'service/s3/api.go', line 23327
|
func ObjectVersionStorageClass_Values() []string
ObjectVersionStorageClass_Values returns all elements of the ObjectVersionStorageClass enum
23346 23347 23348 23349 23350 |
// File 'service/s3/api.go', line 23346
|
func Permission_Values() []string
Permission_Values returns all elements of the Permission enum
23370 23371 23372 23373 23374 23375 23376 23377 23378 |
// File 'service/s3/api.go', line 23370
|
func Protocol_Values() []string
Protocol_Values returns all elements of the Protocol enum
23389 23390 23391 23392 23393 23394 |
// File 'service/s3/api.go', line 23389
|
func ReplicationRuleStatus_Values() []string
ReplicationRuleStatus_Values returns all elements of the ReplicationRuleStatus enum
23405 23406 23407 23408 23409 23410 |
// File 'service/s3/api.go', line 23405
|
func ReplicationStatus_Values() []string
ReplicationStatus_Values returns all elements of the ReplicationStatus enum
23427 23428 23429 23430 23431 23432 23433 23434 |
// File 'service/s3/api.go', line 23427
|
func RequestCharged_Values() []string
RequestCharged_Values returns all elements of the RequestCharged enum
23444 23445 23446 23447 23448 |
// File 'service/s3/api.go', line 23444
|
func RequestPayer_Values() []string
RequestPayer_Values returns all elements of the RequestPayer enum
23463 23464 23465 23466 23467 |
// File 'service/s3/api.go', line 23463
|
func RetentionDirective_Values() []string
RetentionDirective_Values returns all elements of the RetentionDirective enum
23478 23479 23480 23481 23482 23483 |
// File 'service/s3/api.go', line 23478
|
func ServerSideEncryption_Values() []string
ServerSideEncryption_Values returns all elements of the ServerSideEncryption enum
23494 23495 23496 23497 23498 23499 |
// File 'service/s3/api.go', line 23494
|
func StorageClass_Values() []string
StorageClass_Values returns all elements of the StorageClass enum
23528 23529 23530 23531 23532 23533 23534 23535 23536 23537 23538 23539 |
// File 'service/s3/api.go', line 23528
|
func TaggingDirective_Values() []string
TaggingDirective_Values returns all elements of the TaggingDirective enum
23550 23551 23552 23553 23554 23555 |
// File 'service/s3/api.go', line 23550
|
func Tier_Values() []string
Tier_Values returns all elements of the Tier enum
23572 23573 23574 23575 23576 23577 23578 23579 |
// File 'service/s3/api.go', line 23572
|
func TransitionStorageClass_Values() []string
TransitionStorageClass_Values returns all elements of the TransitionStorageClass enum
23602 23603 23604 23605 23606 23607 23608 23609 23610 23611 |
// File 'service/s3/api.go', line 23602
|
func Type_Values() []string
Type_Values returns all elements of the Type enum
23625 23626 23627 23628 23629 23630 23631 |
// File 'service/s3/api.go', line 23625
|
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
|