21 lines
305 B
Go
21 lines
305 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"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)
|
|
}
|