Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerFunc ¶
type HandlerFunc func(events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
The HandlerFunc type defines what a handler function should look like.
type RecoverFunc ¶
type RecoverFunc func(events.APIGatewayProxyRequest, error)
The RecoverFunc type defines what a panic recovery function should look like.
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
The Route type defines a route that can be used by the router.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
The Router type handles incoming requests & routes them to the registered handlers.
func (*Router) HandleRequest ¶
func (r *Router) HandleRequest(req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
HandleRequest determines which route an incoming HTTP request should be sent down. If no route has been specified for a given HTTP method, an error is returned.
func (*Router) Handler ¶
func (r *Router) Handler(method string, fn HandlerFunc) *Route
Handler adds a given handler to the router.
func (*Router) Recovery ¶
func (r *Router) Recovery(fn RecoverFunc) *Router
Recovery sets a custom recovery handler that will be used when any handlers panic.
Click to show internal directories.
Click to hide internal directories.