Documentation
¶
Overview ¶
Package httpclient provides a centralized HTTP client configuration for pipeleek. It offers a retryable HTTP client with cookie support, custom headers, and proxy configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPipeleekHTTPClient ¶
func GetPipeleekHTTPClient(cookieUrl string, cookies []*http.Cookie, defaultHeaders map[string]string) *retryablehttp.Client
GetPipeleekHTTPClient creates and configures a retryable HTTP client for pipeleek operations. It supports:
- Cookie jar configuration for session management
- Custom default headers
- Automatic retry logic for 429 and 5xx errors (except 501)
- HTTP proxy support via HTTP_PROXY environment variable
- TLS certificate verification bypass (InsecureSkipVerify)
Parameters:
- cookieUrl: The URL to associate cookies with (required if cookies are provided)
- cookies: Optional cookies to add to the jar
- defaultHeaders: Optional headers to add to all requests
Returns a configured *retryablehttp.Client ready for use.
Types ¶
type HeaderRoundTripper ¶
type HeaderRoundTripper struct {
Headers map[string]string
Next http.RoundTripper
}
HeaderRoundTripper is an http.RoundTripper that adds default headers to requests. Headers are only added if they're not already present in the request.
Click to show internal directories.
Click to hide internal directories.