Documentation ¶
Index ¶
- Variables
- func Get(options *types.Options, configuration *Configuration) (*retryablehttp.Client, error)
- func GetHttpTimeout(opts *types.Options) time.Duration
- func GetRawHTTP(options *types.Options) *rawhttp.Client
- func Init(options *types.Options) error
- type Configuration
- type ConnectionConfiguration
- type RedirectFlow
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Dialer is a copy of the fastdialer from protocolstate Dialer *fastdialer.Dialer // ResponseHeaderTimeout is the timeout for response headers // to be read from the server (this prevents infinite hang started by server if any) ResponseHeaderTimeout = time.Duration(5) * time.Second // HttpTimeoutMultiplier is the multiplier for the http timeout HttpTimeoutMultiplier = 3 )
Functions ¶
func Get ¶
func Get(options *types.Options, configuration *Configuration) (*retryablehttp.Client, error)
Get creates or gets a client for the protocol based on custom configuration
func GetHttpTimeout ¶
GetHttpTimeout returns the http timeout for the client
func GetRawHTTP ¶
GetRawHTTP returns the rawhttp request client
Types ¶
type Configuration ¶
type Configuration struct { // Threads contains the threads for the client Threads int // MaxRedirects is the maximum number of redirects to follow MaxRedirects int // NoTimeout disables http request timeout for context based usage NoTimeout bool // DisableCookie disables cookie reuse for the http client (cookiejar impl) DisableCookie bool // FollowRedirects specifies the redirects flow RedirectFlow RedirectFlow // Connection defines custom connection configuration Connection *ConnectionConfiguration }
Configuration contains the custom configuration options for a client
func (*Configuration) HasStandardOptions ¶
func (c *Configuration) HasStandardOptions() bool
HasStandardOptions checks whether the configuration requires custom settings
func (*Configuration) Hash ¶
func (c *Configuration) Hash() string
Hash returns the hash of the configuration to allow client pooling
type ConnectionConfiguration ¶
type ConnectionConfiguration struct { // DisableKeepAlive of the connection DisableKeepAlive bool // contains filtered or unexported fields }
ConnectionConfiguration contains the custom configuration options for a connection
func (*ConnectionConfiguration) GetCookieJar ¶
func (cc *ConnectionConfiguration) GetCookieJar() *cookiejar.Jar
func (*ConnectionConfiguration) HasCookieJar ¶
func (cc *ConnectionConfiguration) HasCookieJar() bool
func (*ConnectionConfiguration) SetCookieJar ¶
func (cc *ConnectionConfiguration) SetCookieJar(cookiejar *cookiejar.Jar)
type RedirectFlow ¶
type RedirectFlow uint8
const ( DontFollowRedirect RedirectFlow = iota FollowSameHostRedirect FollowAllRedirect )
Click to show internal directories.
Click to hide internal directories.