Documentation ¶
Index ¶
- Constants
- func DefaultConfig(indent string) []byte
- func GetClient(tr *http.Transport, http2Tr bool, GlobalTimeout time.Duration) (*http.Client, liberr.Error)
- func GetTransport(DisableKeepAlive, DisableCompression, ForceHTTP2 bool) *http.Transport
- func SetTransportDial(tr *http.Transport, forceIp bool, netw libptc.NetworkProtocol, ...)
- func SetTransportProxy(tr *http.Transport, proxyUrl *url.URL)
- func SetTransportTLS(tr *http.Transport, tls libtls.TLSConfig, servername string)
- type FctHttpClient
- type OptionForceIP
- type OptionProxy
- type OptionTLS
- type Options
Constants ¶
View Source
const ( ClientTimeout30Sec = 30 * time.Second ClientTimeout10Sec = 10 * time.Second ClientTimeout5Sec = 5 * time.Second ClientTimeout1Sec = 1 * time.Second ClientNetworkTCP = "tcp" ClientNetworkUDP = "udp" )
View Source
const ( ErrorParamEmpty liberr.CodeError = iota + liberr.MinPkgHttpCli ErrorParamInvalid ErrorValidatorError ErrorClientTransportHttp2 )
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶ added in v1.10.0
func GetTransport ¶ added in v1.11.3
func SetTransportDial ¶ added in v1.11.3
func SetTransportProxy ¶ added in v1.11.3
Types ¶
type FctHttpClient ¶ added in v1.10.0
type OptionForceIP ¶ added in v1.9.0
type OptionForceIP struct { Enable bool `json:"enable" yaml:"enable" toml:"enable" mapstructure:"enable"` Net libptc.NetworkProtocol `json:"net,omitempty" yaml:"net,omitempty" toml:"net,omitempty" mapstructure:"net,omitempty"` IP string `json:"ip,omitempty" yaml:"ip,omitempty" toml:"ip,omitempty" mapstructure:"ip,omitempty"` Local string `json:"local,omitempty" yaml:"local,omitempty" toml:"local,omitempty" mapstructure:"local,omitempty"` }
type OptionProxy ¶ added in v1.11.3
type OptionProxy struct { Enable bool `json:"enable" yaml:"enable" toml:"enable" mapstructure:"enable"` Endpoint *url.URL `json:"endpoint" yaml:"endpoint" toml:"endpoint" mapstructure:"endpoint"` Username string `json:"username" yaml:"username" toml:"username" mapstructure:"username"` Password string `json:"password" yaml:"password" toml:"password" mapstructure:"password"` }
type Options ¶ added in v1.9.0
type Options struct { Timeout time.Duration `json:"timeout" yaml:"timeout" toml:"timeout" mapstructure:"timeout"` Http2 bool `json:"http2" yaml:"http2" toml:"http2" mapstructure:"http2"` TLS OptionTLS `json:"tls" yaml:"tls" toml:"tls" mapstructure:"tls"` ForceIP OptionForceIP `json:"force_ip" yaml:"force_ip" toml:"force_ip" mapstructure:"force_ip"` Proxy OptionProxy `json:"proxy" yaml:"proxy" toml:"proxy" mapstructure:"proxy"` }
Click to show internal directories.
Click to hide internal directories.