Documentation ¶
Index ¶
Constants ¶
View Source
const ( HTTP2xx = 2 HTTP4xx = 4 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Getter ¶
type HTTPClient ¶
type HTTPClient struct { // Initial backoff duration. Defaults to 50 milliseconds InitialBackoff time.Duration // Maximum exp backoff duration. Defaults to 5 seconds MaxBackoff time.Duration // Maximum number of connection retries. Defaults to 15 MaxRetries int // Headers to add to the request. Header http.Header // contains filtered or unexported fields }
func NewHTTPClient ¶
func NewHTTPClient() *HTTPClient
func NewHTTPClientHeader ¶
func NewHTTPClientHeader(header http.Header) *HTTPClient
func (*HTTPClient) Get ¶
func (h *HTTPClient) Get(dataURL string) ([]byte, error)
func (*HTTPClient) GetRetry ¶
func (h *HTTPClient) GetRetry(rawurl string) ([]byte, error)
GetRetry fetches a given URL with support for exponential backoff and maximum retries
Click to show internal directories.
Click to hide internal directories.