Documentation
¶
Index ¶
- type APIGHandler
- type APIGRequest
- type APIGResponse
- type APIGRouter
- func (r *APIGRouter) Delete(route string, handlers ...APIGHandler)
- func (r *APIGRouter) Get(route string, handlers ...APIGHandler)
- func (r *APIGRouter) Patch(route string, handlers ...APIGHandler)
- func (r *APIGRouter) Post(route string, handlers ...APIGHandler)
- func (r *APIGRouter) Put(route string, handlers ...APIGHandler)
- func (r *APIGRouter) Respond() events.APIGatewayProxyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIGHandler ¶
type APIGHandler func(req *APIGRequest, res *APIGResponse)
APIGHandler is the interface a handler function must implement to be used with Get, Post, Put, Patch, and Delete.
type APIGRequest ¶
type APIGRequest struct {
Claims map[string]interface{}
Path map[string]string
QryStr map[string]string
Request *events.APIGatewayProxyRequest
}
APIGRequest is used as the input of handler functions. The Claims, Path, and QryStr will be populated by the the APIGatewayProxyRequest. The Request itself is also passed through if you need further access.
type APIGResponse ¶
APIGResponse is used as the output of handler functions. Populate Status and Body with your http response or populate Err with your error.
type APIGRouter ¶
type APIGRouter struct {
// contains filtered or unexported fields
}
APIGRouter is the object that handlers build upon and is used in the end to respond.
func NewAPIGRouter ¶
func NewAPIGRouter(r *events.APIGatewayProxyRequest, svcprefix string) *APIGRouter
NewAPIGRouter creates a new router using the request and a prefix to strip from your incoming requests.
func (*APIGRouter) Delete ¶
func (r *APIGRouter) Delete(route string, handlers ...APIGHandler)
Delete creates a new delete endpoint.
func (*APIGRouter) Get ¶
func (r *APIGRouter) Get(route string, handlers ...APIGHandler)
Get creates a new get endpoint.
func (*APIGRouter) Patch ¶
func (r *APIGRouter) Patch(route string, handlers ...APIGHandler)
Patch creates a new patch endpoint
func (*APIGRouter) Post ¶
func (r *APIGRouter) Post(route string, handlers ...APIGHandler)
Post creates a new post endpoint.
func (*APIGRouter) Put ¶
func (r *APIGRouter) Put(route string, handlers ...APIGHandler)
Put creates a new put endpoint.
func (*APIGRouter) Respond ¶
func (r *APIGRouter) Respond() events.APIGatewayProxyResponse
Respond returns an APIGatewayProxyResponse to respond to the lambda request.