KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
go-lambda
★ 20
Open GitHub ↗
Go architecture for AWS Lambda
Download README (.md)
Explore Similar Repositories
master_detail_scaffold
:
A Flutter package that contains widgets that help implement a responsive master-detail layout
LongTermGlobalLocalization
:
Long Term Global Localization leveraging Linear Geometry (Based on ORB-SLAM)
omnidet-rotinv
:
Repo for annotations used in WACV2019 paper "Omnidirectional Pedestrian Detection by Rotation Invariant Training"
declarativ
:
A declarative HTML rendering library that is definitely not JSX.
Handwritten-Chinese-character-recognition-system
:
手写汉字识别系统
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
go-lambda
?
Download (.md)
# Go Lambda Go architecture for AWS Lambda ## Requirements - [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) - [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) - [Docker installed](https://www.docker.com/community-edition) - [Golang](https://golang.org) This is the explanation of our file structure: ```bash . ├── domain <-- All domains/entities belong here ├── user <-- Module directory │ └── handler │ └── user-get <-- Source code for a lambda function │ ├── main.go <-- Lambda function code │ └── main_test.go <-- Unit tests │ └── repository │ ├── mysql_repository.go <-- Repository for our db │ └── mysql_repository_test.go <-- Unit tests │ └── usecase │ ├── user_usecase.go <-- Business rules │ └── user_usecase_test.go <-- Unit tests │ ├── infra <-- All external framework/drivers ├── utils <-- Shared utilities ├── Makefile <-- Make to automate build └── template.yaml <-- Cloudformation template ``` ## Setup process ### Installing dependencies ```shell make deps docker-compose up -d ``` ### Building ```shell make build ``` ### Local development **Invoking function locally through local API Gateway** ```bash make local ``` If the previous command ran successfully you should now be able to hit the following local endpoint to invoke your function `http://localhost:3000/hello` ## Packaging and deployment The following command will package your lambda functions, create a Cloudformation Stack and deploy your SAM resources: ```bash make deploy ``` After deployment is complete you can run the following command to retrieve the API Gateway Endpoint URL: ```bash make describe ``` ### Testing We use `testing` package that is built-in in Golang and you can simply run the following command to run our tests: ```shell go test -v ./handlers/hello-world/ ``` For mocking purpose, we use `gomock` from Golang to help us to generate mock files quickly. ## Inspiration - [https://github.com/awslabs/serverless-application-model](https://github.com/awslabs/serverless-application-model) - [https://github.com/bxcodec/go-clean-arch](https://github.com/bxcodec/go-clean-arch) ## TODO - Resource tagging