The transfer acceleration feature allows users worldwide to access objects stored in Object Storage Service (OSS) buckets in a short period of time. This feature is applicable to scenarios in which data must be transferred over long geographical distances, and can also be used to download or upload large objects that are gigabytes or terabytes in size.
Notes
The sample code in this topic uses the China (Hangzhou) region ID
cn-hangzhouas an example. By default, the public endpoint is used. If you want to access OSS from other Alibaba Cloud services in the same region, you must use an internal endpoint. For more information about the mappings between OSS regions and endpoints, see OSS regions and endpoints.In this topic, access credentials are obtained from environment variables. For more information about how to configure access credentials, see Configure access credentials.
Sample code
References
For the complete sample code that is used to enable transfer acceleration for a bucket, visit put_bucket_transfer_acceleration.go and get_bucket_transfer_acceleration.go.
For more information about the API operation that you can call to enable transfer acceleration for a bucket, see PutBucketTransferAcceleration.
For more information about the API operation that you can call to query the status of transfer acceleration, see GetBucketTransferAcceleration.