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

Top 4.1% on proxy.golang.org
Top 2.8% dependent packages on proxy.golang.org
Top 3.5% dependent repos on proxy.golang.org
Top 4.2% forks on proxy.golang.org

proxy.golang.org : github.com/palantir/pkg/safehttp

Package safehttp provides types and functions that allow http.Client functions to be used in a manner that ensures that HTTP connections are not leaked. The default implementation of http.Client functions such as "Get" and "Post" return a reader as part of the response object. The connection used by the call can be reused only if the body of the response is fully drained and closed. In practice, it is easy to forget that both of these actions are necessary, which can lead to a large number of leaked/persistent http connections. The safehttp package provides functions that wrap the http.Client functionality for functions that return responses in a manner that also returns a cleanup function that drains and closes the body of the response. Callers can simply defer the returned cleanup function to ensure that the connections are properly relinquished. It is safe for the cleanup function to execute even if the body has already been drained or closed.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/palantir/pkg/safehttp
Keywords: octo-correct-managed
License: BSD-3-Clause
Latest release: over 2 years ago
First release: over 5 years ago
Namespace: github.com/palantir/pkg
Dependent packages: 4
Dependent repositories: 2
Stars: 51 on GitHub
Forks: 32 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 3 days ago

    Loading...
    Readme
    Loading...