Documentation ¶
Index ¶
- type AwsHttp2Client
- func (h2 *AwsHttp2Client) ConnKeepAlive(v time.Duration)
- func (h2 *AwsHttp2Client) ConnectTimeout(v time.Duration)
- func (h2 *AwsHttp2Client) ExpectContinueTimeout(v time.Duration)
- func (h2 *AwsHttp2Client) IdleConnTimeout(v time.Duration)
- func (h2 *AwsHttp2Client) MaxAllIdleConns(v int)
- func (h2 *AwsHttp2Client) MaxHostIdelConns(v int)
- func (h2 *AwsHttp2Client) NewHttp2Client() (*http.Client, error)
- func (h2 *AwsHttp2Client) ResponseHeaderTimeout(v time.Duration)
- func (h2 *AwsHttp2Client) TlsHandshakeTimeout(v time.Duration)
- type HttpClientSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AwsHttp2Client ¶
type AwsHttp2Client struct {
Options *HttpClientSettings
}
func (*AwsHttp2Client) ConnKeepAlive ¶
func (h2 *AwsHttp2Client) ConnKeepAlive(v time.Duration)
Dialer.KeepAlive: negative value disables keep-alive; 0 enables keep-alive default = keep-alive enabled
func (*AwsHttp2Client) ConnectTimeout ¶
func (h2 *AwsHttp2Client) ConnectTimeout(v time.Duration)
Dialer.Timeout: maximum amount of time a dial will wait for a connection to be created default = 30 seconds
func (*AwsHttp2Client) ExpectContinueTimeout ¶
func (h2 *AwsHttp2Client) ExpectContinueTimeout(v time.Duration)
Transport.ExpectContinueTimeout: maximum amount of time to wait for a server's first response headers after fully writing the request headers,
if the response has an "Expect: 100-continue" header, this time does not include the time to send the request header, the http client sends its payload after this timeout is exhausted
default = 1 second; set to 0 for no timeout and send request payload without waiting
func (*AwsHttp2Client) IdleConnTimeout ¶
func (h2 *AwsHttp2Client) IdleConnTimeout(v time.Duration)
Transport.IdleConnTimeout: maximum amount of time to keep an idle network connection alive between http requests default = 0 for no limit
func (*AwsHttp2Client) MaxAllIdleConns ¶
func (h2 *AwsHttp2Client) MaxAllIdleConns(v int)
Transport.MaxIdleConns: maximum number of idle (keep-alive) connections across all hosts,
use case: increasing this value when many connections in a short period from same clients
default = 0 means no limit
func (*AwsHttp2Client) MaxHostIdelConns ¶
func (h2 *AwsHttp2Client) MaxHostIdelConns(v int)
Transport.MaxIdleConnsPerHost: maximum number of idle (keep-alive) connections to keep per-host,
use case: increasing this value when many connections in a short period from same clients
default = 0 means 2 idle connections per host
func (*AwsHttp2Client) NewHttp2Client ¶
func (h2 *AwsHttp2Client) NewHttp2Client() (*http.Client, error)
NewHttp2Client returns custom http2 client for aws connection
func (*AwsHttp2Client) ResponseHeaderTimeout ¶
func (h2 *AwsHttp2Client) ResponseHeaderTimeout(v time.Duration)
Transport.ResponseHeaderTimeout: maximum amount of time to wait for a client to read the response header,
if the client isn't able to read the response's header within this duration, the request fails with a timeout error, warning: when using long-running lambda functions, as the operation does not return any response headers until the lambda has finished or timeout
default = no timeout, waits forever
func (*AwsHttp2Client) TlsHandshakeTimeout ¶
func (h2 *AwsHttp2Client) TlsHandshakeTimeout(v time.Duration)
Transport.TLSHandshakeTimeout: maximum amount of time waiting for a TLS handshake to be completed default = 10 seconds; 0 means no timeout
type HttpClientSettings ¶
type HttpClientSettings struct { // Dialer.KeepAlive: negative value disables keep-alive; 0 enables keep-alive // default = keep-alive enabled ConnKeepAlive *time.Duration // Dialer.Timeout: maximum amount of time a dial will wait for a connection to be created // default = 30 seconds Connect *time.Duration // Transport.ExpectContinueTimeout: maximum amount of time to wait for a server's first response headers after fully writing the request headers, // if the response has an "Expect: 100-continue" header, // this time does not include the time to send the request header, // the http client sends its payload after this timeout is exhausted // default = 1 second; set to 0 for no timeout and send request payload without waiting ExpectContinue *time.Duration // Transport.IdleConnTimeout: maximum amount of time to keep an idle network connection alive between http requests // default = 0 for no limit IdleConn *time.Duration // Transport.MaxIdleConns: maximum number of idle (keep-alive) connections across all hosts, // use case: increasing this value when many connections in a short period from same clients // default = 0 means no limit MaxAllIdleConns *int // Transport.MaxIdleConnsPerHost: maximum number of idle (keep-alive) connections to keep per-host, // use case: increasing this value when many connections in a short period from same clients // default = 0 means 2 idle connections per host MaxHostIdleConns *int // Transport.ResponseHeaderTimeout: maximum amount of time to wait for a client to read the response header, // if the client isn't able to read the response's header within this duration, the request fails with a timeout error, // warning: when using long-running lambda functions, as the operation does not return any response headers until the lambda has finished or timeout // default = no timeout, waits forever ResponseHeader *time.Duration // Transport.TLSHandshakeTimeout: maximum amount of time waiting for a TLS handshake to be completed // default = 10 seconds; 0 means no timeout TlsHandshake *time.Duration }
settings based on aws documentation