You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the client configuration options with the BuildableHTTPClient is fairly awkward to use. If multiple options are desired like Transport and Dialer the return value of the option method must be recasted back to the BuildableHTTPClient before the new option can be applied.
e.g. in the updated EC2 IMDS client custom configuration of the Client's timeouts requires this cast.
client:=aws.NewBuildableHTTPClient()
// Use a custom Dial timeout for the EC2 Metadata service to account// for the possibility the application might not be running in an// environment with the service present. The client should fail fast in// this case.client=c.WithDialerOptions(func(d*net.Dialer) {
d.Timeout=defaultDialerTimeout
})
// Cast back to the BuildableHTTPClient to add additional options.c=client.(*aws.BuildableHTTPClient)
// Use a custom Transport timeout for the EC2 Metadata service to// account for the possibility that the application might be running in// a container, and EC2Metadata service drops the connection after a// single IP Hop. The client should fail fast in this case.client=c.WithTransportOptions(func(tr*http.Transport) {
tr.ResponseHeaderTimeout=defaultResponseHeaderTimeout
})
The text was updated successfully, but these errors were encountered:
jasdel
changed the title
aws.BuildableHTTPClient builder pattern is awkward to use.
aws.BuildableHTTPClient with options method pattern is awkward to use.
Sep 16, 2020
…ckage
Moves the BuildableHTTPClient from the SDK's `aws` package to the
`aws/transport/http` package as `BuildableClient` to with other HTTP specific
utilities.
Updates the BuildableClient's method return type to be the
BuildableClient type to make chaining `With` statements more natural.
Fixes#730
Moves the BuildableHTTPClient from the SDK's aws package to the aws/transport/http package as BuildableClient to with other HTTP specific utilities.
Updates the BuildableClient's method return type to be the BuildableClient type to make chaining With statements more natural.
Fixes#730
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Using the client configuration options with the BuildableHTTPClient is fairly awkward to use. If multiple options are desired like Transport and Dialer the return value of the option method must be recasted back to the BuildableHTTPClient before the new option can be applied.
e.g. in the updated EC2 IMDS client custom configuration of the Client's timeouts requires this cast.
The text was updated successfully, but these errors were encountered: