Another complete rework
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/aws/aws-lambda-go/lambda"
|
||||
)
|
||||
|
||||
type MyEvent struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type MyResponse struct {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
func HandleRequest(ctx context.Context, event MyEvent) (MyResponse, error) {
|
||||
return MyResponse{
|
||||
Message: fmt.Sprintf("Hello %s from Go Lambda!", event.Name),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
lambda.Start(HandleRequest)
|
||||
}
|
||||
Reference in New Issue
Block a user