Versions in this module Expand all Collapse all v0 v0.1.0 Nov 4, 2025 Changes in this version + const DefaultBackoffFactor + const DefaultDialTimeout + const DefaultInitialBackoff + const DefaultJitterFactor + const DefaultMaxBackoff + const DefaultMaxRetries + const DefaultRedirectCacheTTL + const DefaultTimeout + const DefaultUserAgent + func ClearRedirectDiskCache() error + func GetCachedRedirect(sourceURL string) (string, bool) + func IsRetriable(err error) bool + func IsRetriableStatus(code int) bool + func NewDefaultHTTPClient() *http.Client + func NewHTTPClient(config TransportConfig) *http.Client + func NewTransport(config TransportConfig) http.RoundTripper + func ParseRetryAfter(headerValue string) time.Duration + func ProtocolVersion(resp *http.Response) string + func ResetGlobalClient() + func ResetRedirectCache() + func SetCachedRedirect(sourceURL, targetURL string) error + type Client struct + func GetGlobalClient() *Client + func NewClient(cfg *Config) *Client + func NewClientWithOptions(opts ...Option) *Client + func (c *Client) Do(ctx context.Context, req *http.Request) (*http.Response, error) + func (c *Client) DoWithRetry(ctx context.Context, req *http.Request) (*http.Response, error) + func (c *Client) Get(ctx context.Context, url string) (*http.Response, error) + func (c *Client) ResolveRedirect(ctx context.Context, url string) (string, error) + func (c *Client) SetUserAgent(ua string) + type Config struct + CircuitBreakerConfig *resilience.CircuitBreakerConfig + DialTimeout time.Duration + EnableHTTP2 bool + EnableTracing bool + Logger observability.Logger + MaxIdleConns int + RateLimiterConfig *resilience.TokenBucketConfig + RetryConfig *RetryConfig + TLSConfig *tls.Config + Timeout time.Duration + UserAgent string + func DefaultConfig() *Config + type Option func(*Config) + func WithMaxIdleConns(n int) Option + func WithMaxRetries(n int) Option + func WithRetryConfig(retryCfg *RetryConfig) Option + func WithTLSConfig(tlsCfg *tls.Config) Option + func WithTimeout(timeout time.Duration) Option + func WithUserAgent(ua string) Option + type RetryConfig struct + BackoffFactor float64 + InitialBackoff time.Duration + JitterFactor float64 + MaxBackoff time.Duration + MaxRetries int + func DefaultRetryConfig() *RetryConfig + func (rc *RetryConfig) CalculateBackoff(attempt int) time.Duration + type TransportConfig struct + EnableHTTP2 bool + EnableHTTP3 bool + ExpectContinueTimeout time.Duration + IdleConnTimeout time.Duration + MaxConnsPerHost int + MaxIdleConns int + MaxIdleConnsPerHost int + ResponseHeaderTimeout time.Duration + TLSHandshakeTimeout time.Duration + func DefaultTransportConfig() TransportConfig