Documentation
¶
Index ¶
- func HTTPStatusText(status int) string
- func MakeCall(method, URI string, msg io.Reader, header map[string]string, auth *Auth, ...) (map[string]interface{}, int, error)
- func Reachable(host, name string, timeout int, disableVerifyCert bool) (bool, error)
- type Auth
- type Client
- func (c *Client) Fetch(method, url string, auth *Auth, header map[string]string, body io.Reader) (*http.Response, error)
- func (c *Client) FetchTLS(method, url string, auth Auth, header map[string]string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) FetchTLSWithContext(ctx context.Context, method, url string, auth Auth, header map[string]string, ...) (*http.Response, error)
- func (c *Client) FetchWithContext(ctx context.Context, method, url string, auth *Auth, header map[string]string, ...) (*http.Response, error)
- func (c *Client) ProxiedClient() *http.Client
- type ClientCert
- type ClientOption
- func CheckRedirectUserLastResp(b bool) ClientOption
- func DialKeepAliveTimeout(i int) ClientOption
- func DialTimeout(i int) ClientOption
- func DisableVerifyClientCert(b bool) ClientOption
- func HTTPClientRequestTimeout(i int) ClientOption
- func HTTPClientResponseHeaderTimeout(i int) ClientOption
- func IdleConnectionTimeout(i int) ClientOption
- func MaxIdleConnections(i int) ClientOption
- func TLSHandshakeTimeout(i int) ClientOption
- type HTTPClient
- type HTTPClientSettings
- type Info
- type TestClient
- type TraceInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPStatusText ¶ added in v0.0.16
HTTPStatusText lookup status code for text
Types ¶
type Client ¶
type Client struct { DialTimeout time.Duration DialKeepAliveTimeout time.Duration MaxIdleConnections int IdleConnTimeout time.Duration TLSHandshakeTimeout time.Duration ResponseHeaderTimeout time.Duration //ExpectContinueTimeout time.Duration // will disable HTTP2 if used HTTPClientRequestTimeout time.Duration CheckRedirectUserLastResp bool // contains filtered or unexported fields }
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
func (*Client) FetchTLSWithContext ¶ added in v0.0.10
func (*Client) FetchWithContext ¶ added in v0.0.10
func (*Client) ProxiedClient ¶
ProxiedClient Proxy should be set with os.Setenv
type ClientCert ¶
type ClientOption ¶
type ClientOption func(h *Client)
func CheckRedirectUserLastResp ¶ added in v0.0.18
func CheckRedirectUserLastResp(b bool) ClientOption
func DialKeepAliveTimeout ¶
func DialKeepAliveTimeout(i int) ClientOption
func DialTimeout ¶
func DialTimeout(i int) ClientOption
func DisableVerifyClientCert ¶
func DisableVerifyClientCert(b bool) ClientOption
func HTTPClientRequestTimeout ¶ added in v0.0.21
func HTTPClientRequestTimeout(i int) ClientOption
func HTTPClientResponseHeaderTimeout ¶ added in v0.0.21
func HTTPClientResponseHeaderTimeout(i int) ClientOption
func IdleConnectionTimeout ¶
func IdleConnectionTimeout(i int) ClientOption
func MaxIdleConnections ¶
func MaxIdleConnections(i int) ClientOption
func TLSHandshakeTimeout ¶
func TLSHandshakeTimeout(i int) ClientOption
type HTTPClient ¶ added in v0.0.16
type HTTPClient struct { Method string URL string Header map[string]string ReturnHead bool ReturnKeys []string ReturnCert bool ReUseClient bool RedirectUseLastResponse bool Auth *Auth RequestTimeout int ResponseHeaderTimeout int DialTimeout int DialKeepAliveTimeout int MaxIdleConnections int IdleConnectionTimeout int TLSHandshakeTimeout int DisableVerifyClientCert bool CatchAllErrStatus int }
HTTPClient data store
func NewHTTPClient ¶ added in v0.0.16
func NewHTTPClient(method, url string, header map[string]string, auth *Auth, settings *HTTPClientSettings) *HTTPClient
NewHTTPClient initialize HTTPClient
type HTTPClientSettings ¶ added in v0.0.16
type HTTPClientSettings struct { ReturnHeaders bool DisableVerifyClientCert bool RequestTimeout int ResponseHeaderTimeout int ReturnCert bool ReUseClient bool RedirectUseLastResponse bool DialTimeout int DialKeepAliveTimeout int MaxIdleConnections int IdleConnectionTimeout int TLSHandshakeTimeout int CatchAllErrStatus int }
func NewClientSettings ¶ added in v0.0.16
func NewClientSettings(returnHeaders, disableVerifyClientCert bool, requestTimeout, responseHeaderTimeout int) *HTTPClientSettings
type TestClient ¶
type TestClient struct { }
type TraceInfo ¶ added in v0.0.7
type TraceInfo struct { Start time.Time `json:"start"` DNS Info `json:"dns"` Connect Info `json:"connect"` TLSHandshake Info `json:"tls_handshake"` Connection Info `json:"connection"` GotFirstResponseByte Info `json:"got_first_response_byte"` WroteHeaders Info `json:"wrote_headers"` WroteRequest Info `json:"wrote_request"` }
func Trace ¶ added in v0.0.7
func Trace() (*httptrace.ClientTrace, *TraceInfo)
Click to show internal directories.
Click to hide internal directories.