Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultUserAgent = "fsgo/1.0"
DefaultUserAgent default user agent
Functions ¶
This section is empty.
Types ¶
type Transport ¶
type Transport struct { // Proxy 可选, 当前已支持 http_proxy、https_proxy // 若 Proxy 为 nil,将使用 http.ProxyFromEnvironment Proxy func(*http.Request) (*url.URL, error) // DialContext 可选,拨号 DialContext func(ctx context.Context, network, addr string) (net.Conn, error) // DialTLSContext 可选,TLS 拨号 DialTLSContext func(ctx context.Context, network, addr string) (net.Conn, error) // TLSClientConfig 可选 TLSClientConfig *tls.Config // WriteTimeout 可选,设置写超时时间 WriteTimeout func(req *http.Request, conn net.Conn) error // ReadTimeout 可选,设置读超时时间 ReadTimeout func(req *http.Request, conn net.Conn) error }
Transport 一个简单的 Transport
不管理连接,可以使用外部连接池
Click to show internal directories.
Click to hide internal directories.