aws

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToAwsError added in v1.0.3

func ToAwsError(err error) awserr.Error

Types

type AwsHttp2Client

type AwsHttp2Client struct {
	Options *HttpClientSettings
}

AwsHttp2Client struct defines container for HttpClientSettings

func (*AwsHttp2Client) ConnKeepAlive

func (h2 *AwsHttp2Client) ConnKeepAlive(v time.Duration)

ConnKeepAlive sets 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)

ConnectTimeout sets 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)

ExpectContinueTimeout sets 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)

IdleConnTimeout sets 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)

MaxAllIdleConns sets 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) MaxHostIdleConns added in v1.2.3

func (h2 *AwsHttp2Client) MaxHostIdleConns(v int)

MaxHostIdleConns sets 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)

ResponseHeaderTimeout sets 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)

TlsHandshakeTimeout sets 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
}

HttpClientSettings based on aws documentation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL