Documentation
¶
Index ¶
- Constants
- func CtxRequestID(r *http.Request) string
- func CtxRequestMethod(r *http.Request) string
- func CtxRequestPath(r *http.Request) string
- func CtxRequestProtocol(r *http.Request) string
- func DecodeJSON(body io.Reader, input interface{}) error
- func ID(h http.Handler) http.Handler
- func Info(h http.Handler) http.Handler
Constants ¶
View Source
const ( CtxRequestProtocolKey ctxInfo = iota CtxRequestMethodKey CtxRequestPathKey )
View Source
const CtxRequestIDKey = ctxID(iota)
Variables ¶
This section is empty.
Functions ¶
func CtxRequestID ¶ added in v0.0.4
CtxRequestID retrieves the `X-Request-ID` from the current request `context`.
func CtxRequestMethod ¶ added in v0.0.4
CtxRequestMethod retrieves the request method from the current request `context`.
func CtxRequestPath ¶ added in v0.0.4
CtxRequestPath retrieves the request path from the current request `context`.
func CtxRequestProtocol ¶ added in v0.0.4
CtxRequestProtocol retrieves the request protocol from the current request `context`.
func DecodeJSON ¶
DecodeJSON decodes json formatted request body into incoming struct. All errors contain a response friendly error message.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.