Documentation ¶
Overview ¶
Package httpd provides components to build a HTTP service.
We are using the echo HTTP framework for routing and middleware. At the top level we provide extensions to the echo framework. HTTP route handlers are defined in the subpackage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapContext ¶
func WrapContext(h echo.HandlerFunc) echo.HandlerFunc
WrapContext wraps echo.Context as Context.
You can register this function as middleware in echo such that our extended Context type can be interferred from our handlers.
Types ¶
type Context ¶
Context extends echo.Context.
A context can be seen as the bigger scope in which a HTTP response and request life. We extend the default context provided by the echo framework to give us an entry point for utilities.
func (*Context) Accepts ¶
Accepts returns true if the client accepts the given mime type.
By using this method we can distinguish between the data format used by different clients. For example a web application might prefer JSON formated data while a java application might prefer XML.
In case of the client accepting all mime types "*/*" this function will just return true.
func (*Context) ContentType ¶
ContentType returns the normalized mime type of the request content.