chang code
This commit is contained in:
parent
9f2e438ab6
commit
07641871f2
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
|
|
@ -28,14 +27,7 @@ func NewOptions(options ...Option) *Options {
|
||||||
return code == http.StatusOK
|
return code == http.StatusOK
|
||||||
},
|
},
|
||||||
|
|
||||||
HttpClient: &http.Client{
|
HttpClient: http.DefaultClient,
|
||||||
Timeout: 10 * time.Second,
|
|
||||||
Transport: &http.Transport{
|
|
||||||
MaxIdleConns: 10, // 最大空闲连接数
|
|
||||||
MaxIdleConnsPerHost: 5, // 每个主机的最大空闲连接数
|
|
||||||
IdleConnTimeout: 10 * time.Second, // 空闲连接超时时间
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, option := range options {
|
for _, option := range options {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue