Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(opts Options) http.RoundTripper
New wraps a transport to provide smart connection pooling and client-side load balancing.
Types ¶
type Options ¶
type Options struct {
Transport *http.Transport
// Host is the only host that can be reached through the round tripper.
// Default: management.azure.com
Host string
// PoolSize is the max number of connections that will be created by the connection pool.
// Default: 8
PoolSize int
// RecycleThreshold is the lowest value of any X-Ms-Ratelimit-Remaining-* header that
// can be seen before the associated connection will be re-established.
// Default: 100
RecycleThreshold int64
// MinReqsBeforeRecycle is a safeguard to prevent frequent connection churn in the unlikely event
// that a connections lands on an ARM instance that already has a depleted rate limiting quota.
// Default: 10
MinReqsBeforeRecycle int64
// TransportFactory is a function that creates a new transport for a given connection.
TransportFactory func(id int, parent *http.Transport, host string, port string, recycleThreshold, minReqsBeforeRecycle int64) http.RoundTripper
}
Click to show internal directories.
Click to hide internal directories.