Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetPool ¶
func SetPool(pool HTTPPool)
SetPool sets the global pool for mcp clients This allows external pools to be injected
func SetPoolConfig ¶
func SetPoolConfig(config *PoolConfig)
SetPoolConfig sets the configuration for the mcp package's default pool Must be called before any HTTP calls are made (before GetPool)
Types ¶
type DefaultPool ¶
type DefaultPool struct {
// contains filtered or unexported fields
}
DefaultPool is the default HTTP pool implementation
func NewDefaultPool ¶
func NewDefaultPool() *DefaultPool
NewDefaultPool creates a new default HTTP pool with sensible defaults Deprecated: Use SetPoolConfig and GetPool instead
func (*DefaultPool) GetHTTPClient ¶
func (p *DefaultPool) GetHTTPClient() *http.Client
GetHTTPClient returns the shared HTTP client
type HTTPPool ¶
HTTPPool interface for HTTP client providers Implementations can provide connection pooling, custom timeouts, etc.
type PoolConfig ¶
type PoolConfig struct {
// InsecureSkipVerify allows self-signed certificates
// WARNING: This should be false in production for security
InsecureSkipVerify bool
// Connection pool settings
MaxIdleConns int
MaxIdleConnsPerHost int
IdleConnTimeout time.Duration
// Default timeout for requests
Timeout time.Duration
}
PoolConfig holds configuration for the default pool in the mcp package
func DefaultPoolConfig ¶
func DefaultPoolConfig() *PoolConfig
DefaultPoolConfig returns sensible defaults (secure by default) Optimized for long-lived AI/MCP connections
func GetPoolConfig ¶
func GetPoolConfig() PoolConfig
GetPoolConfig returns the current pool configuration Returns a copy to prevent external modification of internal state