Skip to content

Commit 24c2eea

Browse files
committed
add sdk migration to go usage
1 parent 62ab518 commit 24c2eea

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

docs/golang/Usage-CN.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type Config struct {
9797
LocalAddr *string // 本地网卡 ip
9898
HttpProxy *string // http 的代理
9999
HttpsProxy *string // https 的代理
100-
NoProxy *string // 代理白名单
100+
NoProxy *string // 代理白名单,以 ;分割
101101
Socks5Proxy *string // socks5 代理
102102
Socks5NetWork *string // socks5 代理协议
103103
MaxIdleConns *int // 最大连接数
@@ -122,3 +122,23 @@ type RuntimeOptions struct {
122122
Socks5NetWork *string // socks5 代理协议
123123
}
124124
```
125+
126+
## SDK 迁移
127+
若想将 [老SDK](https://github.com/aliyun/alibaba-cloud-sdk-go) 迁移到 [新SDK](https://github.com/aliyun/alibabacloud-sdk), 可以参考一下几点:
128+
129+
- 新版本默认不开启超时,超时时间的单位为毫秒
130+
- 新版本默认不开启重试
131+
- 新版本暂不支持并发
132+
- `Request` 仅支持配置业务参数
133+
- `Response` 仅包含 `API` 返回参数
134+
- `RuntimeOptions``Config` 中相同的参数, `RuntimeOptions` 的优先级高于 `Config`
135+
136+
- `Config` 删除了 `Debug`, `EnableAsync`, `HttpTransport`, `Transport`, `MaxTaskQueueSize`, `GoRoutinePoolSize` 的配置
137+
-`Config``AutoRetry`,改为通过 `RuntimeOptions``Autoretry` 来配置
138+
-`Config``MaxRetryTime`,改为通过 `RuntimeOptions``MaxAttempts` 来配置
139+
-`Config``Timeout`,改为 `ReadTimeout` 来配置
140+
-`Config``Scheme`,改为 `Protocol` 来配置
141+
142+
- `Client` 删除了 `logger`, `signer`, `httpClient`, `asyncTaskQueue`, `debug`, `isRunning`, `asyncChanLock` 的配置
143+
-`Client``isInsecure`,改为通过 `RuntimeOptions``IgnoreSSL` 来配置
144+
-`Client``Domain`,改为 `Endpoint` 来配置

docs/golang/Usage-EN.md

+20
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,23 @@ type RuntimeOptions struct {
121121
Socks5NetWork *string // socks5 agency agreement
122122
}
123123
```
124+
125+
## SDK Migration
126+
If you wnat to migrate the [Old SDK](https://github.com/aliyun/alibaba-cloud-sdk-go) to the [New SDK](https://github.com/aliyun/alibabacloud-sdk), you can refer to the points:
127+
128+
- The new SDK does not turn on timeouts by default. The timeouts unit is milliseconds
129+
- New SDK does not enable retry by default
130+
- Concurrency is not supported in the new SDK
131+
- `Request` only supports configuring business parameters
132+
- `Response` contains only the `API` return parameter
133+
- The same parameter in `RuntimeOptions` and `Config` , `RuntimeOptions` has a higher priority than `Config`
134+
135+
- `Config` removes configuration of `Debug`, `EnableAsync`, `HttpTransport`, `Transport`, `MaxTaskQueueSize`, `GoRoutinePoolSize`
136+
- The `AutoRetry` of the original `Config`, configured instead by `AutoRetry` of `RuntimeOptions`
137+
- The `MaxRetryTime` of the original `Config`, configured instead by `MaxRetryTime` of `RuntimeOptions`
138+
- The `Timeout` of the original `Config`, configured instead by `ReadTimeout`
139+
- The `Scheme` of the original `Config`, configured instead by `Protocol`
140+
141+
- `Client` removes configuration of `logger`, `signer`, `httpClient`, `asyncTaskQueue`, `Debug`, `isRunning`, `asyncChanLock`
142+
- The `isInsecure` of the original `Client`, configured instead by `IgnoreSSL` of `RuntimeOptions`
143+
- The `Domain` of the original `Client`, configured instead by `Endpoint`

0 commit comments

Comments
 (0)