Documentation ¶
Index ¶
- func CreateDefaultHttpClient() *http.Client
- func CreateHttpClient(timeout, keepAlive, tlsHandshakeTimeout, idleConnection time.Duration, ...) *http.Client
- func CreateOAuth2Client(clientId, clientSecret, accessTokenUri string) (*http.Client, error)
- func CreateOAuth2Config(clientId, clientSecret, accessTokenUri string) (*clientcredentials.Config, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultHttpClient ¶
CreateDefaultHttpClient creates a default http.Client.
Timeout set to 5 seconds, keep alive set to 30 seconds, TLS handshake timeout set to 5 seconds, idleConnection timeout set to 90 seconds, max idle connections is 100, and max idle connections per host is 100.
func CreateHttpClient ¶
func CreateHttpClient(timeout, keepAlive, tlsHandshakeTimeout, idleConnection time.Duration, idleConns, idleConnsPerHost int) *http.Client
CreateHttpClient creates a http.Client from the specified timeouts and keep alive.
The client also has the maximum number of idle connections set to 100 and number of connections per host as 100.
func CreateOAuth2Client ¶ added in v1.0.2
CreateOAuth2Client creates an OAuth2 http.Client from the provided credentials.
func CreateOAuth2Config ¶ added in v1.0.2
func CreateOAuth2Config(clientId, clientSecret, accessTokenUri string) (*clientcredentials.Config, error)
CreateOAuth2Config creates an OAuth2 config from the provided credentials.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.