Region | (必選)請求發送的地區, 必選 | WithRegion("cn-hangzhou") |
CredentialsProvider | (必選)設定訪問憑證 | WithCredentialsProvider(provider) |
Endpoint | 訪問網域名稱 | WithEndpoint("oss-cn-hanghzou.aliyuncs.com") |
HttpClient | HTTP用戶端 | WithHttpClient(customClient) |
RetryMaxAttempts | HTTP請求時的最大嘗試次數, 預設值為 3 | WithRetryMaxAttempts(5) |
Retryer | HTTP請求時的重試實現 | WithRetryer(customRetryer) |
ConnectTimeout | 建立串連的逾時時間, 預設值為 5 秒 | WithConnectTimeout(10 * time.Second) |
ReadWriteTimeout | 應用讀寫資料的逾時時間, 預設值為 10 秒 | WithReadWriteTimeout(30 * time.Second) |
InsecureSkipVerify | 是否跳過SSL認證校正,預設檢查SSL認證 | WithInsecureSkipVerify(true) |
EnabledRedirect | 是否開啟HTTP重新導向, 預設不開啟 | WithEnabledRedirect(true) |
ProxyHost | 設定Proxy 伺服器 | WithProxyHost("http://user:passswd@proxy.example-***.com") |
ProxyFromEnvironment | 通過環境變數設定Proxy 伺服器 | WithProxyFromEnvironment(true) |
UploadBandwidthlimit | 整體的上傳頻寬節流設定,單位為 KiB/s | WithUploadBandwidthlimit(10*1024) |
DownloadBandwidthlimit | 整體的下載頻寬節流設定,單位為 KiB/s | WithDownloadBandwidthlimit(10*1024) |
SignatureVersion | 簽名版本,預設值為v4 | WithSignatureVersion(oss.SignatureVersionV1) |
LogLevel | 設定記錄層級 | WithLogLevel(oss.LogInfo) |
LogPrinter | 設定日誌列印介面 | WithLogPrinter(customPrinter) |
DisableSSL | 不使用https請求,預設使用https | WithDisableSSL(true) |
UsePathStyle | 使用路徑請求風格,即次層網域請求風格,預設為bucket託管網域名稱 | WithUsePathStyle(true) |
UseCName | 是否使用自訂網域名訪問,預設不使用 | WithUseCName(true) |
UseDualStackEndpoint | 是否使用雙棧網域名稱訪問,預設不使用 | WithUseDualStackEndpoint(true) |
UseAccelerateEndpoint | 是否使用傳輸加速網域名稱訪問,預設不使用 | WithUseAccelerateEndpoint(true) |
UseInternalEndpoint | 是否使用內網網域名稱訪問,預設不使用 | WithUseInternalEndpoint(true) |
DisableUploadCRC64Check | 上傳時關閉CRC64校正,預設開啟CRC64校正 | WithDisableUploadCRC64Check(true) |
DisableDownloadCRC64Check | 下載時關閉CRC64校正,預設開啟CRC64校正 | WithDisableDownloadCRC64Check(true) |
AdditionalHeaders | 指定額外的簽章要求頭,V4簽名下有效 | WithAdditionalHeaders([]string{"content-length"}) |
UserAgent | 指定額外的User-Agent資訊 | WithUserAgent("user identifier") |