Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
PoolSize int
MaxRetries int
RefreshInterval time.Duration
ValidationWorkers int
BadProxyMaxAge time.Duration
}
func DefaultConfig ¶
func DefaultConfig() *Config
type ProxyClient ¶ added in v0.0.2
ProxyClient wraps http.Client with ProxyRoundTripper for convenience
func NewProxyClient ¶ added in v0.0.2
func NewProxyClient(config *Config) *ProxyClient
NewProxyClient creates a ProxyClient with stats and close methods
func (*ProxyClient) Close ¶ added in v0.0.2
func (pc *ProxyClient) Close() error
Close stops background workers and cleans up resources
func (*ProxyClient) Stats ¶ added in v0.0.2
func (pc *ProxyClient) Stats() map[string]interface{}
Stats returns current proxy pool statistics
type ProxyRoundTripper ¶ added in v0.0.2
type ProxyRoundTripper struct {
// contains filtered or unexported fields
}
func NewProxyRoundTripper ¶ added in v0.0.2
func NewProxyRoundTripper(config *Config) *ProxyRoundTripper
func (*ProxyRoundTripper) Close ¶ added in v0.0.2
func (rt *ProxyRoundTripper) Close() error
Close stops background workers and cleans up resources
func (*ProxyRoundTripper) RoundTrip ¶ added in v0.0.2
RoundTrip implements the http.RoundTripper interface
func (*ProxyRoundTripper) Stats ¶ added in v0.0.2
func (rt *ProxyRoundTripper) Stats() map[string]interface{}
Stats returns current proxy pool statistics
Click to show internal directories.
Click to hide internal directories.