Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶ added in v0.0.8
func (*Context) RequestID ¶ added in v0.0.8
RequestID will return the request ID stored in the echo.HeaderXRequestID header on the http.Response, or "unknown-request" if the value of the header was an empty string.
Importantly this is on the response header because the request headers are expected to come from outside the service.
type Handler ¶
Handler is a function signature which retains most of the important bits of http.HandlerFunc, but enhances it with an incoming context, so we don't need to mangle the one in http.Request, and returns an error, which will be useful once we have an error handling middleware.
func WrapMiddleware ¶
func WrapMiddleware(mw []Middleware, handler Handler) Handler
WrapMiddleware creates a new handler by wrapping middleware around a final handler. The middlewares' Handlers will be executed by requests in the order they are provided.
type Middleware ¶
Middleware is a function signature that takes a Handler, and returns a Handler. The idea here is that the passed in Handler is going to be wrapped into whatever functionality we need, and then the new, enhanced Handler gets returned.