Documentation
¶
Overview ¶
Package lambda provides a lightweight AWS API Gateway v2 ↔ net/http adapter.
It is a minimal, dependency-free bridge over the AWS Lambda Go events. ServeHTTP converts an APIGatewayV2HTTPRequest into a standard *http.Request, dispatches it to any http.Handler (e.g., a chi router), and converts the captured response back to an APIGatewayV2HTTPResponse.
Usage:
lambda.Start(func(ctx context.Context, req events.APIGatewayV2HTTPRequest) (events.APIGatewayV2HTTPResponse, error) {
return lambdahttp.ServeHTTP(ctx, req, router)
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeHTTP ¶
func ServeHTTP( ctx context.Context, event events.APIGatewayV2HTTPRequest, handler http.Handler, ) (events.APIGatewayV2HTTPResponse, error)
ServeHTTP dispatches an APIGatewayV2HTTPRequest to handler and returns an APIGatewayV2HTTPResponse. This is the single integration point between API Gateway and a net/http handler. Errors are only returned for request conversion failures; handler panics should be caught by RecoverMiddleware.
Types ¶
This section is empty.