Documentation
¶
Index ¶
- type APIGContext
- type APIGHandler
- 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 APIGContext ¶
type APIGContext struct {
Claims map[string]interface{}
Path map[string]string
QryStr map[string]string
Request *events.APIGatewayProxyRequest
Status int
Body []byte
Err error
}
APIGContext is used as the input and output of handler functions. The Body, Claims, Path, and QryStr will be populated by the the APIGatewayProxyRequest. The Request itself is also passed through if you need further access. Fill the Status and Body, or Status and Error to respond.
type APIGHandler ¶
type APIGHandler func(ctx *APIGContext)
APIGHandler is the interface a handler function must implement to be used with Get, Post, Put, Patch, and Delete.
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.