Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHTTPClient ¶
GetHTTPClient returns the shared, TLS-verified HTTP client (lazy initialization). This is the pool used by default for all scripting HTTP requests (requests library, wait_for, etc).
func GetInsecureHTTPClient ¶ added in v0.17.0
GetInsecureHTTPClient returns a separate shared HTTP client with TLS certificate verification disabled (lazy initialization). This pool is entirely independent of GetHTTPClient's pool: enabling insecure mode for one caller (e.g. a script explicitly opting in with insecure=True) never affects the TLS behavior of any other caller using the default pool.
func GetInsecurePool ¶ added in v0.17.0
func GetInsecurePool() *scriptlingPool
GetInsecurePool returns the shared, TLS-skip-verify pool as an HTTPPool interface.
func GetPool ¶
func GetPool() *scriptlingPool
GetPool returns the shared, TLS-verified pool as an HTTPPool interface.
func SetConfig ¶
func SetConfig(config *Config)
SetConfig sets up the shared connection pool configuration (connection limits and timeout, applied to both the secure and insecure pools). Must be called before any HTTP calls are made (before GetHTTPClient / GetInsecureHTTPClient), since each pool is initialized lazily on first use.
Types ¶
type Config ¶
type Config struct {
// Connection pool settings
MaxIdleConns int
MaxIdleConnsPerHost int
IdleConnTimeout time.Duration
// Default timeout for requests
Timeout time.Duration
}
Config holds configuration for a scriptling HTTP pool. Optimized for short-lived, diverse HTTP requests (requests library, wait_for).
InsecureSkipVerify is no longer part of this struct: secure and insecure traffic are served by two entirely separate pools (see GetHTTPClient and GetInsecureHTTPClient) so that opting one caller into skipping TLS verification can never affect requests made by any other caller sharing the pool.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns sensible defaults, applied to both the secure and insecure pools. Optimized for short-lived scripting HTTP requests.