Skip to content

Instantly share code, notes, and snippets.

@sd2995
Last active August 3, 2022 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sd2995/fe6260679c256fe91fec3d864b985f8d to your computer and use it in GitHub Desktop.
Save sd2995/fe6260679c256fe91fec3d864b985f8d to your computer and use it in GitHub Desktop.
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