Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GatewayClient ¶
GatewayClient generates an http client that can invoke API Gateway endpoints with AWS_IAM authentication.
func LambdaProxy ¶
func LambdaProxy(methodHandlers map[string]RequestHandler) func( context.Context, *events.APIGatewayProxyRequest) (*events.APIGatewayProxyResponse, error)
LambdaProxy generates a handler function for API Gateway lambda-proxy backends.
Note: The returned error is always nil. All errors should be reported in the status code of the response.
func MarshalResponse ¶
func MarshalResponse(response interface{}, statusCode int) *events.APIGatewayProxyResponse
MarshalResponse replaces nil maps + slices and serializes a response model.
response is a pointer to a struct and statusCode is the http status to return
func ReplaceMapSliceNils ¶
func ReplaceMapSliceNils(val interface{})
ReplaceMapSliceNils replaces nil slices and maps with initialized versions.
For example, struct{Tags []string} would serialize as "tags: []" instead of "tags: null" The input must be a pointer to a struct.
Types ¶
type RequestHandler ¶
type RequestHandler = func(*events.APIGatewayProxyRequest) *events.APIGatewayProxyResponse
RequestHandler is a function which handles an HTTP request for a single method/resource pair.