Documentation
¶
Overview ¶
Package awslambda provides an adapter that bridges protosource's provider-agnostic handlers to AWS API Gateway Lambda proxy integration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Wrap ¶
func Wrap(handler protosource.HandlerFunc) func(context.Context, events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
Wrap is a convenience function that returns the Handle method directly, suitable for passing to lambda.Start().
func WrapRouter ¶
func WrapRouter(router *protosource.Router) func(context.Context, events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
WrapRouter returns a Lambda handler that dispatches to the router based on the request's HTTP method and path. Suitable for passing to lambda.Start().
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter wraps a protosource.HandlerFunc with AWS API Gateway conversion and actor extraction.
func New ¶
func New(handler protosource.HandlerFunc) *Adapter
New creates an Adapter that converts API Gateway requests to protosource requests, extracts the actor using the provided extractor, and converts the protosource response back to an API Gateway response.
func (*Adapter) Handle ¶
func (a *Adapter) Handle(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
Handle is the Lambda entry point. Pass this to lambda.Start().