Skip to content

Instantly share code, notes, and snippets.

@sd2995
Last active August 3, 2022 04:07
Embed
What would you like to do?
Go lambda integration
package main
import (
"fmt"
"github.com/aws/aws-lambda-go/lambda"
)
type MyEvent struct {
Name string `json:"name"`
}
type MyResponse struct {
Message string `json:"response:"`
}
func HandleLambdaEvent(event MyEvent) (MyResponse, error) {
return MyResponse{Message: fmt.Sprintf("%s is my name !", event.Name)}, nil
}
func main() {
lambda.Start(HandleLambdaEvent)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment