Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Adapt ¶
func Adapt(h http.HandlerFunc, adapters ...Adapter) http.HandlerFunc
Adapt Iterate over adapters and run them one by one
func ResponseWithCustomCode ¶
func ResponseWithCustomCode(w http.ResponseWriter, code int, payload interface{})
ResponseWithJson returns formed JSON
func ResponseWithJson ¶
func ResponseWithJson(w http.ResponseWriter, payload interface{})
ResponseWithJson returns formed JSON
Types ¶
type Adapter ¶
type Adapter func(http.HandlerFunc) http.HandlerFunc
func LogRequestDetails ¶
func LogRequestDetails() Adapter
LogRequestDetails logs the request details including the request method, URL, header keys and now also includes logging the latency
func SetCorsHeaders ¶
func SetCorsHeaders() Adapter
func ValidateRestMethod ¶
ValidateRestMethod middleware to validate proper methods
type StatusRecorder ¶ added in v0.7.6
type StatusRecorder struct { http.ResponseWriter Status int }
func (*StatusRecorder) WriteHeader ¶ added in v0.7.6
func (rec *StatusRecorder) WriteHeader(code int)
Click to show internal directories.
Click to hide internal directories.