{"id":22832981,"url":"https://github.com/yezarela/go-lambda","last_synced_at":"2025-04-23T21:50:58.013Z","repository":{"id":57545027,"uuid":"210407528","full_name":"yezarela/go-lambda","owner":"yezarela","description":"Go architecture for AWS Lambda","archived":false,"fork":false,"pushed_at":"2024-01-09T08:19:57.000Z","size":44,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T03:51:10.945Z","etag":null,"topics":["aws-lambda","clean-architecture","go","mysql","serverless"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yezarela.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-23T16:54:46.000Z","updated_at":"2025-03-26T23:34:25.000Z","dependencies_parsed_at":"2024-01-09T09:27:50.118Z","dependency_job_id":"7f494667-0f70-48be-b6f2-d8f9789579fd","html_url":"https://github.com/yezarela/go-lambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezarela%2Fgo-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezarela%2Fgo-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezarela%2Fgo-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezarela%2Fgo-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yezarela","download_url":"https://codeload.github.com/yezarela/go-lambda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522293,"owners_count":21444510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","clean-architecture","go","mysql","serverless"],"created_at":"2024-12-12T21:11:16.418Z","updated_at":"2025-04-23T21:50:57.999Z","avatar_url":"https://github.com/yezarela.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Lambda\n\nGo architecture for AWS Lambda \n\n## Requirements\n\n- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) \n- [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)\n- [Docker installed](https://www.docker.com/community-edition)\n- [Golang](https://golang.org)\n\nThis is the explanation of our file structure:\n\n```bash\n.\n├── domain                           \u003c-- All domains/entities belong here\n├── user                             \u003c-- Module directory\n│   └── handler                     \n│       └── user-get                 \u003c-- Source code for a lambda function\n│           ├── main.go              \u003c-- Lambda function code\n│           └── main_test.go         \u003c-- Unit tests\n│   └── repository \n│       ├── mysql_repository.go      \u003c-- Repository for our db\n│       └── mysql_repository_test.go \u003c-- Unit tests\n│   └── usecase \n│       ├── user_usecase.go          \u003c-- Business rules\n│       └── user_usecase_test.go     \u003c-- Unit tests\n│\n├── infra                            \u003c-- All external framework/drivers \n├── utils                            \u003c-- Shared utilities\n├── Makefile                         \u003c-- Make to automate build\n└── template.yaml                    \u003c-- Cloudformation template\n```\n\n## Setup process\n\n### Installing dependencies\n\n```shell\nmake deps\ndocker-compose up -d\n```\n\n### Building\n\n```shell\nmake build\n```\n\n### Local development\n\n**Invoking function locally through local API Gateway**\n\n```bash\nmake local\n```\n\nIf the previous command ran successfully you should now be able to hit the following local endpoint to invoke your function `http://localhost:3000/hello`\n\n## Packaging and deployment\n\nThe following command will package your lambda functions, create a Cloudformation Stack and deploy your SAM resources:\n\n```bash\nmake deploy\n```\n\nAfter deployment is complete you can run the following command to retrieve the API Gateway Endpoint URL:\n\n```bash\nmake describe\n```\n\n### Testing\n\nWe use `testing` package that is built-in in Golang and you can simply run the following command to run our tests:\n\n```shell\ngo test -v ./handlers/hello-world/\n```\nFor mocking purpose, we use `gomock` from Golang to help us to generate mock files quickly.\n\n## Inspiration\n\n- [https://github.com/awslabs/serverless-application-model](https://github.com/awslabs/serverless-application-model)\n- [https://github.com/bxcodec/go-clean-arch](https://github.com/bxcodec/go-clean-arch)\n\n## TODO\n- Resource tagging\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyezarela%2Fgo-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyezarela%2Fgo-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyezarela%2Fgo-lambda/lists"}