All Products
Search
Document Center

Object Storage Service:Download objects (Go SDK V2)

Last Updated:Aug 02, 2025

Object Storage Service (OSS) SDK for Go V2 provides various download operations. You can select suitable operations based on your business scenarios.

Type

API Name

Description

Simple download

Client.GetObject

  • Perform streaming download. The type of the response body is io.ReadCloser.

  • Do not support CRC-64.

  • Do not directly support the progress bar feature.

  • Do not support reconnection for failed connections during streaming read.

Client.GetObjectToFile

  • Download objects as local files.

  • Download using a single connection.

  • Support CRC-64 (enabled by default).

  • Support the progress bar feature.

  • Support reconnection for failed connections.

Range download

Client.GetObject

  • Download a specific range of data.

Read-only class file (Go SDK V2)

ReadOnlyFile

ReadOnlyFile.Read

ReadOnlyFile.Seek

ReadOnlyFile.Close

  • Provide File-Like operations that support operations of the io.Reader, io.Seeker, and io.Closer types.

  • Provide the Seek capability.

  • Support the single-stream mode (default).

  • Support the asynchronous prefetch mode to improve the read speed.

  • Specify the prefetch of blocks and the number of prefetch chunks.

  • Do not support CRC-64.

  • Do not directly support the progress bar feature.

  • Support reconnection for failed connections.

A signed URL

Client.Presign

  • Generate a signed URL that allows HTTP GET requests and has a validity period to authorize users to download an object.

File Download Manager (Go SDK V2)

Downloader.DownloadFile

  • Download objects as local files by performing multipart download.

  • Specify the size of parts and number of parts that can be downloaded in parallel.

  • Support CRC-64 (enabled by default).

  • Support the progress bar feature.

  • Support reconnection for failed connections.

  • Support resumable download.

  • Download an object to a temporary object and rename the temporary object (enabled by default). You can modify the configurations.