Documentation ¶
Index ¶
- func New(ctx context.Context, opts Options) http.RoundTripper
- func NewHostScopedTransport(ctx context.Context, transportFactory func() *transportChannPool) *hostScopedTransport
- type ClosableTransport
- type KillBeforeThrottledPolicy
- type Options
- type Transport
- type TransportDropPolicy
- type TransportDropPolicyFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(ctx context.Context, opts Options) http.RoundTripper
New wraps a transport to provide smart connection pooling and client-side load balancing.
func NewHostScopedTransport ¶
Types ¶
type ClosableTransport ¶
func (*ClosableTransport) ForceClose ¶
func (transport *ClosableTransport) ForceClose() error
type KillBeforeThrottledPolicy ¶
type KillBeforeThrottledPolicy struct {
RecycleThreshold int64
}
func (*KillBeforeThrottledPolicy) ShouldDropTransport ¶
func (policy *KillBeforeThrottledPolicy) ShouldDropTransport(header http.Header) bool
type Options ¶
type Options struct { Transport *http.Transport // 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 }
type Transport ¶
type Transport interface { http.RoundTripper ForceClose() error }
type TransportDropPolicy ¶
type TransportDropPolicyFunc ¶
func (TransportDropPolicyFunc) ShouldDropTransport ¶
func (function TransportDropPolicyFunc) ShouldDropTransport(header http.Header) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.