1 Star 0 Fork 0

sonysoul / iris

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
client.go 535 Bytes
一键复制 编辑 原始数据 按行查看 历史
package netutil
import (
"net"
"net/http"
"time"
"github.com/kataras/golog"
)
// Client returns a new http.Client using
// the "timeout" for open connection.
func Client(timeout time.Duration) *http.Client {
transport := http.Transport{
Dial: func(network string, addr string) (net.Conn, error) {
conn, err := net.DialTimeout(network, addr, timeout)
if err != nil {
golog.Debugf("%v", err)
return nil, err
}
return conn, err
},
}
client := &http.Client{
Transport: &transport,
}
return client
}
1
https://gitee.com/sonysoul/iris.git
git@gitee.com:sonysoul/iris.git
sonysoul
iris
iris
v11.1.1

搜索帮助

53164aa7 5694891 3bd8fe86 5694891