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

Top 7.6% on proxy.golang.org
Top 7.0% forks on proxy.golang.org

proxy.golang.org : github.com/karrick/gohm

Package gohm is a tiny Go library with HTTP middleware functions. gohm provides a small collection of middleware functions to be used when creating a HTTP micro service written in Go. One function in particular, gohm.Error, is not used as HTTP middleware, but as a helper for emitting a sensible error message back to the HTTP client when the HTTP request could not be fulfilled. It emits a text response beginning with the status code, the human friendly status message, followed by an optional text message. It is meant to be a drop in replacement for http.Error message, that formats the error message in a more conventional way to include the status code and message. All the other gohm functions are HTTP middleware functions, designed to wrap any HTTP handler, composing some functionality around it. They can be interchanged and used with other HTTP middleware functions providing those functions adhere to the http.Handler interface and have a ServeHTTP(http.ResponseHandler, *http.Request) method. *NOTE:* When both the WithTimeout and the ConvertPanicsToErrors are used, the WithTimeout ought to wrap the ConvertPanicsToErrors. This is because timeout handlers in Go are generally implemented using a separate goroutine, and the panic could occur in an alternate goroutine and not get caught by the ConvertPanicsToErrors.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/karrick/gohm
License: MIT
Latest release: over 7 years ago
First release: over 8 years ago
Namespace: github.com/karrick
Stars: 4 on GitHub
Forks: 1 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 16 days ago

    Loading...
    Readme
    Loading...