Documentation ¶
Index ¶
- Variables
- type ProxyMiddleware
- func (m *ProxyMiddleware) GetProxyCount() int
- func (m *ProxyMiddleware) Process(ctx context.Context, httpClient *http.Client, req *http.Request, ...) (*http.Response, error)
- func (m *ProxyMiddleware) SetLogger(l logger.Logger)
- func (m *ProxyMiddleware) Shuffle()
- func (m *ProxyMiddleware) UpdateProxies(newProxies []*url.URL)
- type SkipProxyKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidTransport = errors.New("invalid transport")
Functions ¶
This section is empty.
Types ¶
type ProxyMiddleware ¶
type ProxyMiddleware struct {
// contains filtered or unexported fields
}
ProxyMiddleware manages proxy rotation for HTTP requests.
func New ¶
func New(proxies []*url.URL) *ProxyMiddleware
New creates a new ProxyMiddleware instance.
func (*ProxyMiddleware) GetProxyCount ¶
func (m *ProxyMiddleware) GetProxyCount() int
GetProxyCount returns the current number of proxies in the list.
func (*ProxyMiddleware) Process ¶
func (m *ProxyMiddleware) Process(ctx context.Context, httpClient *http.Client, req *http.Request, next middleware.NextFunc) (*http.Response, error)
Process applies proxy logic before passing the request to the next middleware.
func (*ProxyMiddleware) SetLogger ¶
func (m *ProxyMiddleware) SetLogger(l logger.Logger)
SetLogger sets the logger for the middleware.
func (*ProxyMiddleware) Shuffle ¶
func (m *ProxyMiddleware) Shuffle()
Shuffle randomizes the order of the proxies.
func (*ProxyMiddleware) UpdateProxies ¶
func (m *ProxyMiddleware) UpdateProxies(newProxies []*url.URL)
UpdateProxies updates the list of proxies at runtime.
type SkipProxyKey ¶
type SkipProxyKey struct{}
Click to show internal directories.
Click to hide internal directories.