Documentation ¶
Overview ¶
Package lambda provides a kind of http server emulator for lambda functions. That is an adapter which translates an incoming AWS APIGatewayProxyRequests to a regular http.Request and an outgoing http response to a AWS APIGatewayProxyResponse
The use case are http applications which should be packaged and deployed as lambda functions and possibly at the same time as a normal local executable webapplication. So appart from this adapter function the rest of the application is unaware of the fact that it runs as a lambda function.
So instead of
func main(){ //... http.Serve (socket, handler) }
for a regular http server
func main(){ //... lambda.Serve (handler, logerror, loginfo) }
can be used to serve http applications from lambda functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdaptorFunc ¶
func AdaptorFunc(handler http.Handler, logerror, loginfo func(ctx context.Context, logmessage string)) func(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
AdaptorFunc adapts a regular http.Handler to an AWS lambda handler
func AddReqIdToCtx ¶
AddReqIdToCtx adds the lambda request ID to the context
func GetAliasFromRequest ¶
func ReqIdFromCtx ¶
ReqIdFromCtx reads the lambda request ID from the context
Types ¶
This section is empty.