Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
MaxIdleConns int
MaxIdleConnsPerHost int
MaxConnsPerHost int
MaxTotalConns int
DialTimeout time.Duration
KeepAlive time.Duration
TLSHandshakeTimeout time.Duration
ResponseHeaderTimeout time.Duration
IdleConnTimeout time.Duration
ExpectContinueTimeout time.Duration
TLSConfig *tls.Config
MinTLSVersion uint16
MaxTLSVersion uint16
InsecureSkipVerify bool
EnableHTTP2 bool
HTTP2MaxStreams int
ProxyURL string
AllowPrivateIPs bool
DisableCompression bool
DisableKeepAlives bool
ForceAttemptHTTP2 bool
CookieJar interface{}
}
Config defines connection pool configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns optimized default configuration
type HostStats ¶
type HostStats struct {
Host string
ActiveConns int64
IdleConns int64
TotalConns int64
FailedConns int64
LastUsed int64 // Unix timestamp
AverageLatency int64 // Nanoseconds
}
HostStats tracks per-host connection statistics
type Metrics ¶
type Metrics struct {
ActiveConnections int64
IdleConnections int64
TotalConnections int64
RejectedConnections int64
ConnectionHitRate float64
LastUpdate int64
}
Metrics provides connection pool performance metrics
type PoolManager ¶
type PoolManager struct {
// contains filtered or unexported fields
}
PoolManager provides intelligent connection pool management with monitoring
func NewPoolManager ¶
func NewPoolManager(config *Config) (*PoolManager, error)
NewPoolManager creates a new connection pool manager
func (*PoolManager) Close ¶
func (pm *PoolManager) Close() error
func (*PoolManager) GetMetrics ¶
func (pm *PoolManager) GetMetrics() Metrics
func (*PoolManager) GetTransport ¶
func (pm *PoolManager) GetTransport() *http.Transport
func (*PoolManager) IsHealthy ¶
func (pm *PoolManager) IsHealthy() bool