An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

proxy.golang.org : github.com/taskcluster/httpbackoff : v1.0.0

This package provides exponential backoff support for making HTTP requests. It uses the github.com/cenkalti/backoff algorithm. Network failures and HTTP 5xx status codes qualify for retries. HTTP calls that return HTTP 4xx status codes do not get retried. If the last HTTP request made does not result in a 2xx HTTP status code, an error is returned, together with the data. There are several utility methods that wrap the standard net/http package calls. Any function that takes no arguments and returns (*http.Response, error) can be retried using this library's Retry function. The methods in this library should be able to run concurrently in multiple go routines. Consider this trivial HTTP GET request: This can be rewritten as follows, enabling automatic retries: The variable attempts stores the number of http calls that were made (one plus the number of retries).

Registry - Documentation - Download - JSON
purl: pkg:golang/github.com/taskcluster/[email protected]
Published:
Indexed:

    Loading...
    Readme
    Loading...