增加获取http client方法
This commit is contained in:
@ -38,7 +38,6 @@ type Api struct {
|
||||
SuccessCodeList []string `json:"success_code_list" yaml:"success_code_list"` // 成功的值(优先级高, 会覆盖)
|
||||
SuccessHttpCodeList []int `json:"success_http_code_list" yaml:"success_http_code_list"` // 任务成功的http状态码, 不配置默认只有200(优先级高, 会覆盖)
|
||||
Header map[string]string `json:"header" yaml:"header"` // 传入的header
|
||||
Cookie map[string]string `json:"cookie" yaml:"cookie"` // 传入的cookie
|
||||
BindURIParamList []string `json:"bind_uri_param_list" yaml:"bind_uri_param_list"` // 绑定到URI的参数列表
|
||||
Timeout ApiTimeout `json:"timeout" yaml:"timeout"`
|
||||
Retry ApiRetry `json:"retry" yaml:"retry"` // 重试策略
|
||||
@ -67,3 +66,10 @@ type ApiRetry struct {
|
||||
Count int `json:"count" yaml:"count"` // 重试次数
|
||||
Frequency int `json:"frequency" yaml:"frequency"` // 重试频率, 单位 : ms
|
||||
}
|
||||
|
||||
const (
|
||||
// DefaultConnectTimeout 默认连接超时
|
||||
DefaultConnectTimeout = 100
|
||||
// DefaultReadTimeout 默认读取超时
|
||||
DefaultReadTimeout = 300
|
||||
)
|
||||
|
Reference in New Issue
Block a user