Documentation
¶
Index ¶
- func DoRequest(f RequestFunc, insecureSkipVerify bool) (*http.Response, []byte, *httperr.Error)
- func DoRequestWithRetries(f RequestFunc, insecureSkipVerify bool) ([]byte, *httperr.Error)
- func GetNextBackoff(resp *http.Response, initialBackoff time.Duration, attempt int) time.Duration
- func GetURL(baseURL string, query map[string]string, paths ...string) (string, *httperr.Error)
- func ParseRetryAfter(resp *http.Response) (time.Duration, bool)
- func ShouldRetry(status int) bool
- type RequestFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoRequestWithRetries ¶
func DoRequestWithRetries(f RequestFunc, insecureSkipVerify bool) ([]byte, *httperr.Error)
DoRequestWithRetries sends HTTP requests and returns HTTP response; retries if needed
func GetNextBackoff ¶ added in v0.3.0
GetNextBackoff determines the retry delay from Retry-After header or exponential backoff
func GetURL ¶ added in v0.3.0
GetURL builds a fully-qualified URL from a base URL, optional path segments, and optional query parameters.
func ParseRetryAfter ¶ added in v0.3.0
func ShouldRetry ¶ added in v0.3.0
ShouldRetry returns true if the given HTTP status code is retryable
Types ¶
Click to show internal directories.
Click to hide internal directories.