Ecosyste.ms: Packages

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

Top 2.0% on proxy.golang.org
Top 0.3% dependent packages on proxy.golang.org
Top 0.5% dependent repos on proxy.golang.org
Top 5.6% forks on proxy.golang.org
Top 0.2% docker downloads on proxy.golang.org

proxy.golang.org : github.com/PuerkitoBio/rehttp

Package rehttp implements an HTTP transport that handles retries. An HTTP client can be created with a *rehttp.Transport as RoundTripper and it will apply the retry strategy to its requests. The retry strategy is provided by the Transport, which determines whether or not the request should be retried, and if so, what delay to apply before retrying, based on the RetryFn and DelayFn functions passed to NewTransport. The package offers common delay strategies as ready-made functions that return a DelayFn: It also provides common retry helpers that return a RetryFn: Those can be combined with RetryAny or RetryAll as needed. RetryAny enables retries if any of the RetryFn return true, while RetryAll enables retries if all RetryFn return true. Typically, the RetryFn of the Transport should use at least RetryMaxRetries and some other retry condition(s), combined using RetryAll. By default, the Transport will buffer the request's body in order to be able to retry the request, as a request attempt will consume and close the existing body. Sometimes this is not desirable, so it can be prevented by setting PreventRetryWithBody to true on the Transport. Doing so will disable retries when a request has a non-nil body. This package requires Go version 1.6+, since it uses the new http.Request.Cancel field in order to cancel requests. It doesn't implement the deprecated http.Transport.CancelRequest method (https://golang.org/pkg/net/http/#Transport.CancelRequest). On Go1.7+, it uses the context returned by http.Request.Context to check for cancelled requests. Before Go1.7, PerAttemptTimeout has no effect. It should work on Go1.5, but only if there is no timeout set on the *http.Client. Go's stdlib will return an error on the first request if that's the case, because it requires a RoundTripper that implements the CancelRequest method.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/%21puerkito%21bio/rehttp
Keywords: http-client, retry
License: BSD-3-Clause
Latest release: 7 months ago
First release: about 6 years ago
Namespace: github.com/PuerkitoBio
Dependent packages: 201
Dependent repositories: 194
Stars: 200 on GitHub
Forks: 15 on GitHub
Docker dependents: 95
Docker downloads: 279,463,074
Total Commits: 50
Committers: 2
Average commits per author: 25.0
Development Distribution Score (DDS): 0.02
More commit stats: commits.ecosyste.ms
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/mna, https://www.buymeacoffee.com/mna
Last synced: 17 days ago

    Loading...
    Readme
    Loading...