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