Documentation ¶
Index ¶
- Variables
- func GetTransport(opts ...func(*http.Transport) error) (http.RoundTripper, error)
- func UnmarshalResponse(resp *http.Response) (interface{}, interface{}, error)
- func WithTLSClientAuth(cert tls.Certificate) func(*http.Transport) error
- func WithTLSInsecureSkipVerify(v bool) func(*http.Transport) error
- func WithTLSRootCA(caCert []byte) func(*http.Transport) error
- type HTTPClient
- type HTTPClientConfig
- type UnmarshalFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var NewHTTPClient = defaultHTTPClientFactory
NewHTTPClient is a factory of HTTPClient
Functions ¶
func GetTransport ¶ added in v1.9.1
func UnmarshalResponse ¶
UnmarshalResponse takes an http Response and returns: - its body, deserialized if content-type appropriate - metadata such as headers and status code
func WithTLSClientAuth ¶ added in v1.9.1
func WithTLSClientAuth(cert tls.Certificate) func(*http.Transport) error
func WithTLSInsecureSkipVerify ¶ added in v1.9.1
Types ¶
type HTTPClient ¶ added in v1.3.0
HTTPClient is an interface for decoupling http.Client
type HTTPClientConfig ¶ added in v1.3.0
type HTTPClientConfig struct { Timeout time.Duration FollowRedirect bool Transport http.RoundTripper }
HTTPClientConfig is a set of options used to initialize a HTTPClient
type UnmarshalFunc ¶
UnmarshalFunc is a type of function capable of taking the body of an http response and deserialize it into a target interface{}
Click to show internal directories.
Click to hide internal directories.