How aws/aws-lambda-go works
AWS Lambda for Go is a runtime and support library for implementing Go functions: it receives Lambda invocations, decodes and dispatches them to a function, then reports success or failure. It also supplies event schemas, Lambda context access, Function URL HTTP adaptation, and CloudFormation custom-resource response handling. The runtime orchestration and several event families are identified from the tree and README; their internal wiring is not shown in the sampled source, so uncertain links are omitted.
Main entry points: entry.go Start entry points · invoke_loop.go Invocation loop · handler.go Handler dispatch · http_handler.go Function URL adapter
Components 17
Lambda runtime
- Start entry points
lambda/entry.go - Invocation loop
lambda/invoke_loop.go - Runtime API client
lambda/runtime_api_client.go - Extensions API client
lambda/extensions_api_client.go
Function interfaces
- Handler dispatch
lambda/handler.go - Generic entry
lambda/entry_generic.go - Event schemas
events
AWS integrations
- Function URL adapter
lambdaurl/http_handler.go - URL event schemas
events/lambda_function_urls.go - Custom resource wrapper
cfn/wrap.go - Custom resource event
cfn/event.go - Custom resource response
cfn/response.go
Invocation metadata
- Lambda context
lambdacontext/context.go
Other components
- AWS Lambda
- Function handler
- HTTP application
- CloudFormation
Connections 17
- AWS Lambda → Runtime API client: sends invocation
- Invocation loop → Runtime API client: polls invocations
- Invocation loop → Handler dispatch: dispatches payload
- Start entry points → Handler dispatch: configures handler
- Handler dispatch → Function handler: invokes function
- Runtime API client → AWS Lambda: posts result
- Start entry points → Invocation loop: starts runtime
- Start entry points → Generic entry: supports generic start
- Function URL adapter → URL event schemas: adapts request
- Function URL adapter → HTTP application: serves request
- Function URL adapter → Start entry points: starts Lambda handler
- Custom resource wrapper → Function handler: invokes resource function
- Custom resource wrapper → Custom resource response: builds response
- Custom resource wrapper → Custom resource event: handles event
- Custom resource response → CloudFormation: sends response
- Handler dispatch → Lambda context: provides invocation context
- Invocation loop → Extensions API client: polls extension events