NewRemoteClient 创建远程客户端
(config *RemoteClientConfig)
| 22 | |
| 23 | // NewRemoteClient 创建远程客户端 |
| 24 | func NewRemoteClient(config *RemoteClientConfig) *RemoteClient { |
| 25 | if config.Timeout == 0 { |
| 26 | config.Timeout = 30 * time.Second |
| 27 | } |
| 28 | |
| 29 | return &RemoteClient{ |
| 30 | baseURL: config.BaseURL, |
| 31 | apiKey: config.APIKey, |
| 32 | apiSecret: config.APISecret, |
| 33 | httpClient: &http.Client{ |
| 34 | Timeout: config.Timeout, |
| 35 | }, |
| 36 | headers: config.Headers, |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | // RemoteClientConfig 远程客户端配置 |
| 41 | type RemoteClientConfig struct { |