Documentation
¶
Index ¶
- func ClearPath(string) string
- func WithContext(ctx context.Context, h http.Handler) http.Handler
- func WithQueryNormalizer(h http.Handler) http.Handler
- func WithRecovery(h http.Handler) http.Handler
- func WithRequestStats(h http.Handler, transformers ...PathTransformationFunc) http.Handler
- func WithResponseTime(h http.Handler) http.Handler
- type PathTransformationFunc
- type Recovery
- type ResponseWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithContext ¶
WithContext set the context on the request.
func WithQueryNormalizer ¶
WithQueryNormalizer fixes wrong php query string handling as array
func WithRecovery ¶
WithRecovery recovers from panics and log the error.
func WithRequestStats ¶
func WithRequestStats(h http.Handler, transformers ...PathTransformationFunc) http.Handler
WithRequestStats collects statistics about the request.
Types ¶
type PathTransformationFunc ¶
type Recovery ¶
type Recovery struct {
// contains filtered or unexported fields
}
Recovery is a middleware that will recover from panics and logs the error.
type ResponseWriter ¶
type ResponseWriter interface {
http.ResponseWriter
// Status returns the status code of the response or 0 if the response has
// not be written.
Status() int
}
ResponseWriter is a wrapper around http.ResponseWriter that provides extra information about the response.
func NewResponseWriter ¶
func NewResponseWriter(rw http.ResponseWriter) ResponseWriter
NewResponseWriter create a new ResponseWriter.
Click to show internal directories.
Click to hide internal directories.