Documentation
¶
Index ¶
- type Router
- func (r *Router) Delete(path string, handler lambda.Handler)
- func (r *Router) Get(path string, handler lambda.Handler)
- func (r *Router) Group(prefix string, fn func(r *Router))
- func (r Router) Invoke(ctx context.Context, payload []byte) ([]byte, error)
- func (r *Router) Patch(path string, handler lambda.Handler)
- func (r *Router) Post(path string, handler lambda.Handler)
- func (r *Router) Put(path string, handler lambda.Handler)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router holds the defined routes for use upon invocation.
func (*Router) Delete ¶
Delete adds a new DELETE method route to the router. The path parameter is the route path you wish to define. The handler parameter is a lambda.Handler to invoke if an incoming path matches the route.
func (*Router) Get ¶
Get adds a new GET method route to the router. The path parameter is the route path you wish to define. The handler parameter is a lambda.Handler to invoke if an incoming path matches the route.
func (*Router) Group ¶
Group allows you to define many routes with the same prefix. The prefix parameter will apply the prefix to all routes defined in the function. The fn parmater is a function in which the grouped routes should be defined.
func (*Router) Patch ¶
Patch adds a new PATCH method route to the router. The path parameter is the route path you wish to define. The handler parameter is a lambda.Handler to invoke if an incoming path matches the route.