Documentation
¶
Overview ¶
Package middleware implements reusable HTTP middleware.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultTags ¶
DefaultTags extracts the method and path from the request.
func WithRecovery ¶
WithRecovery recovers from panics and log the error.
Types ¶
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
// BytesWritten returns the number of bytes written to the writer.
BytesWritten() int64
}
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.