-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement scheduled event for fetching available cars
- Add BUILD.bazel file for the `fetchAvailableCars` job - Add main.go file for the `fetchAvailableCars` job - Update serverless.yml to include `fetchAvailableCars` function with scheduled event Signed-off-by: Sean Zheng <blackhorseya@gmail.com>
- Loading branch information
1 parent
5a6457b
commit 2e8d890
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
load("@rules_go//go:def.bzl", "go_binary", "go_library") | ||
|
||
go_library( | ||
name = "fetchAvailableCars_lib", | ||
srcs = ["main.go"], | ||
importpath = "github.com/blackhorseya/sion/adapter/jobs/fetchAvailableCars", | ||
visibility = ["//visibility:private"], | ||
deps = [ | ||
"@com_github_aws_aws_lambda_go//events", | ||
"@com_github_aws_aws_lambda_go//lambda", | ||
], | ||
) | ||
|
||
go_binary( | ||
name = "fetchAvailableCars", | ||
embed = [":fetchAvailableCars_lib"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
|
||
"github.com/aws/aws-lambda-go/events" | ||
"github.com/aws/aws-lambda-go/lambda" | ||
) | ||
|
||
// Handler is our lambda handler invoked by the `lambda.Start` function call. | ||
func Handler(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { | ||
return events.APIGatewayProxyResponse{ | ||
StatusCode: http.StatusOK, | ||
}, nil | ||
} | ||
|
||
func main() { | ||
lambda.Start(Handler) | ||
} |
This file contains 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