auth

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTransport http.RoundTripper = &http.Transport{
	Proxy: http.ProxyFromEnvironment,
	DialContext: (&net.Dialer{
		Timeout:   30 * time.Second,
		KeepAlive: 30 * time.Second,
		DualStack: true,
	}).DialContext,
	MaxIdleConns:          100,
	IdleConnTimeout:       10 * time.Second,
	TLSHandshakeTimeout:   10 * time.Second,
	ExpectContinueTimeout: 1 * time.Second,
}

DefaultTransport is a custom implementation of the DefaultTransport. It limits the IdleConnTimeout to 10 seconds instead of 90 seconds.

from "net/http/transport.go"

View Source
var ErrCannotUpdateIdleConnTimeout = errors.New("cannot update transport")

ErrCannotUpdateIdleConnTimeout is an error returned when the Transport is unable to be updated.

Functions

func UpdateIdleConnectionsTimeout

func UpdateIdleConnectionsTimeout(client *http.Client) error

UpdateIdleConnectionsTimeout limits the default timeout for idle connections to 10 seconds. If the OAuth2 transport is nil, redefine it with our own DefaultTransport. This should limit the number of idle connections left open after the initial requests are made, which in turn should reduce the chances of the number of available connections being depleted.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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