Created
May 12, 2020 08:00
-
-
Save mprokopov/e57f938262f87499a1edc910031441d0 to your computer and use it in GitHub Desktop.
aws lambda example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "context" | |
| "github.com/aws/aws-lambda-go/lambda" | |
| ) | |
| type MyEvent struct { | |
| Name string `json:"name"` | |
| } | |
| func HandleRequest(ctx context.Context, name MyEvent) (string, error) { | |
| return fmt.Sprintf("Hello %s!", name.Name ), nil | |
| } | |
| func main() { | |
| lambda.Start(HandleRequest) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment