{"modulePath":"github.com/theopenlane/httpsling","version":"v0.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpclient\n\nPackage httpclient is a set of utilities for creating and configuring instances of http.Client\n\n## Variables\n\n```go\nvar (\n\t// ErrMaxAttemptsExceeded is returned when the maximum number of attempts is exceeded\n\tErrMaxAttemptsExceeded = errors.New(\"maximum number of attempts exceeded\")\n\t// ErrInvalidTransportType is returned when the transport type is invalid\n\tErrInvalidTransportType = errors.New(\"invalid transport type\")\n)\n```\n\n## Functions\n\n```go\nfunc Apply(c *http.Client, opts ...Option) error\n```\nApply applies options to an existing client\n\n```go\nfunc New(opts ...Option) (*http.Client, error)\n```\nNew builds a new \\*http.Client\n\n## Types\n\n```go\ntype Option interface {\n\tApply(*http.Client) error\n}\n```\nOption is a configuration option for building an http.Client\n\n```go\nfunc CookieJar(opts *cookiejar.Options) Option\n```\nCookieJar installs a cookie jar into the client, configured with the options argument\n\n```go\nfunc MaxRedirects(m int) Option\n```\nMaxRedirects configures the max number of redirects the client will perform before giving up\n\n```go\nfunc NoRedirects() Option\n```\nNoRedirects configures the client to no perform any redirects\n\n```go\nfunc ProxyFunc(f func(request *http.Request) (*url.URL, error)) Option\n```\nProxyFunc configures the client's proxy function.\n\n```go\nfunc ProxyURL(proxyURL string) Option\n```\nProxyURL will proxy all calls through a single proxy URL\n\n```go\nfunc SkipVerify(skip bool) Option\n```\nSkipVerify sets the TLS config's InsecureSkipVerify flag.\n\n```go\nfunc Timeout(d time.Duration) Option\n```\nTimeout configures the client's Timeout property.\n\n```go\ntype OptionFunc func(*http.Client) error\n```\nOptionFunc adapts a function to the Option interface\n\n```go\nfunc (f OptionFunc) Apply(c *http.Client) error\n```\nApply implements Option\n\n```go\ntype TLSOption func(c *tls.Config) error\n```\nA TLSOption is a type of Option which configures the TLS configuration of the client\n\n```go\nfunc (f TLSOption) Apply(c *http.Client) error\n```\nApply implements Option\n\n```go\ntype TransportOption func(transport *http.Transport) error\n```\nTransportOption configures the client's transport\n\n```go\nfunc (f TransportOption) Apply(c *http.Client) error\n```\nApply implements Option\n\n","path":"github.com/theopenlane/httpsling/httpclient","name":"httpclient","synopsis":"Package httpclient is a set of utilities for creating and configuring instances of http.Client","isRedistributable":true}
