All Products
Search
Document Center

:SDK overview (Go SDK V1)

Last Updated:Dec 02, 2025

This topic describes the methods available in the Object Storage Service (OSS) SDK for Go and provides usage examples.

Region operations

Function name

Scenario/Code example

DescribeRegions

Query the endpoint information of all supported regions.

Bucket operations

Category

Function name

Scenario/Code example

Basic operations

CreateBucket

Create a bucket.

DeleteBucket

Delete a bucket.

ListBuckets

List all buckets owned by the requester.

ListObjectsV2

List information about all objects in a bucket.

IsBucketExist

Check whether a bucket exists.

GetBucketInfo

Get information about a bucket.

GetBucketLocation

Get the region where a bucket is located.

GetBucketStat

Get the storage capacity of a bucket and the number of objects in the bucket.

Retention policy (WORM)

InitiateBucketWorm

Create a retention policy.

AbortBucketWorm

Cancel an unlocked retention policy.

CompleteBucketWorm

Lock a retention policy.

ExtendBucketWorm

Extend the retention period of objects in a bucket for which a retention policy is locked.

GetBucketWorm

Get a retention policy.

Access control (ACL)

SetBucketACL

Manage the read and write access permissions of a bucket.

GetBucketACL

Lifecycle

SetBucketLifecycle

Set lifecycle rules for objects in a bucket.

GetBucketLifecycle

Get the lifecycle rules for objects in a bucket.

DeleteBucketLifecycle

Delete the lifecycle rules for objects in a bucket.

Transfer acceleration

SetBucketTransferAcc

Configure transfer acceleration for a bucket.

GetBucketTransferAcc

Get the transfer acceleration configuration of a bucket.

Versioning

SetBucketVersioning

Set the versioning state of a bucket.

GetBucketVersioning

Get the versioning state of a bucket.

ListObjectVersions

View the versioning status of a bucket.

Data replication

PutBucketReplication

Enable and set data replication rules for a bucket.

PutBucketRTC

Enable or disable replication time control (RTC) for existing cross-region replication rules.

GetBucketReplication

View the configured data replication rules for a bucket.

GetBucketReplicationLocation

View the regions where destination buckets for replication are located.

GetBucketReplicationProgress

View the data replication progress of a bucket.

DeleteBucketReplication

Stop data replication tasks and delete the replication configuration of a bucket.

Authorization policy

SetBucketPolicy

Set a bucket policy.

GetBucketPolicy

Get a bucket policy.

DeleteBucketPolicy

Delete a bucket policy.

Bucket inventory

SetBucketInventory

Set inventory rules for a bucket.

GetBucketInventory

View a specified inventory task in a bucket.

ListBucketInventory

View all inventory tasks in a bucket.

DeleteBucketInventory

Delete a specified inventory task in a bucket.

Log storage

SetBucketLogging

Enable access logging for a bucket.

GetBucketLogging

View the access log configuration of a bucket.

DeleteBucketLogging

Disable access logging for a bucket.

Static website

SetBucketWebsite

Set a bucket to static website hosting mode.

GetBucketWebsite

View the static website hosting status of a bucket.

DeleteBucketWebsite

Disable static website hosting for a bucket.

Hotlink protection

SetBucketReferer

Set hotlink protection rules for a bucket.

GetBucketReferer

View the hotlink protection rules of a bucket.

Tags

SetBucketTagging

Add or modify bucket tags.

GetBucketTagging

View bucket tag information.

DeleteBucketTagging

Delete bucket tag information.

Server-side encryption

SetBucketEncryption

Configure encryption rules for a bucket.

GetBucketEncryption

Get the encryption rules of a bucket.

DeleteBucketEncryption

Delete the encryption rules of a bucket.

Pay by requester

SetBucketRequestPayment

Set a bucket to pay-by-requester mode.

GetBucketRequestPayment

View the pay-by-requester configuration of a bucket.

Cross-origin resource sharing (CORS)

SetBucketCORSV2

Set cross-origin resource sharing (CORS) rules for a bucket.

GetBucketCORS

Get the current CORS rules of a bucket.

DeleteBucketCors

Disable the CORS feature for a bucket and delete all CORS rules.

Access tracking

PutBucketAccessMonitor

Configure the access tracking status of a bucket.

GetBucketAccessMonitor

Get the access tracking status of a bucket.

Data indexing

OpenMetaQuery

Enable the metadata management feature for a bucket.

GetMetaQueryStatus

Get the metadata index information of a bucket.

DoMetaQuery

Query for objects that meet specified conditions and list the object information based on the specified fields and sorting method.

CloseMetaQuery

Disable the metadata management feature for a bucket.

Resource group

PutBucketResourceGroup

Configure the resource group to which a bucket belongs.

GetBucketResourceGroup

Get the resource group ID of a bucket.

Custom domain name (CNAME)

CreateBucketCnameToken

Create a CNAME token to verify the ownership of a domain name.

GetBucketCnameToken

Get the created CNAME token.

PutBucketCname

Bind a CNAME record to a bucket.

ListBucketCname

List all CNAME records that are bound to a bucket.

DeleteBucketCname

Delete a bound CNAME record.

Image style

PutBucketStyle

Create an image style.

GetBucketStyle

Get information about a specified image style in a bucket.

ListBucketStyle

List all created image styles in a bucket.

DeleteBucketStyle

Delete a specified image style in a bucket.

Object operations

Category

Function name

Code example

Basic operations

PutObject

Upload an object.

GetObject

Download an object.

CopyObject

Copy an object.

AppendObject

Upload an object using append upload.

DeleteObject

Delete a single object.

DeleteObjects

Delete multiple objects.

GetObjectDetailedMeta

Return the basic metadata of an object, such as its ETag, size, and last modified time. The object content is not returned.

Callback

Include callback parameters in a request to OSS to implement callbacks.

RestoreObject

Restore an Archive object.

SelectObject

Execute an SQL statement on an object and return the result.

Manage folders

PutObject

Create a folder.

DeleteObject

Delete a folder.

Resumable upload

UploadFile

Upload a large file using resumable upload.

Multipart upload

InitiateMultipartUpload

Perform a complete multipart upload.

UploadPart

UploadPartCopy

CompleteMultipartUpload

AbortMultipartUpload

How do you cancel a multipart upload event?

ListMultipartUploads

List all in-progress multipart upload tasks. In-progress tasks are tasks that are initiated but not completed or aborted.

ListUploadedParts

List all successfully uploaded parts that belong to a specified upload ID.

Access control (ACL)

SetObjectACL

Set and get the access permissions of an object.

GetObjectACL

Symbolic link

PutSymlink

Create a symbolic link.

GetSymlink

Get a symbolic link.

Tagging

PutObjectTagging

Set or update object tags.

GetObjectTagging

Get object tag information

DeleteObjectTagging

Delete object tag information.

Image processing

ProcessObject

Process a specified image file.

LiveChannel operations

Category

Function name

Scenario/Code example

Manage LiveChannel

CreateLiveChannel

Create a LiveChannel.

ListLiveChannel

List LiveChannels.

PutLiveChannelStatus

Set the status of a LiveChannel.

SignRtmpURL

Get the signed URL of a LiveChannel.

GetLiveChannelStat

Get the status information of a LiveChannel.

GetLiveChannelInfo

Get the configuration information of a LiveChannel.

PostVodPlaylist

Generate a playlist for a LiveChannel.

GetVodPlaylist

View the playlist of a LiveChannel.

GetLiveChannelHistory

Get the stream ingest records of a LiveChannel.

DeleteLiveChannel

Delete a LiveChannel.