{"id":21658477,"url":"https://github.com/ysugimoto/ginger","last_synced_at":"2025-04-28T11:11:27.994Z","repository":{"id":57552130,"uuid":"119490682","full_name":"ysugimoto/ginger","owner":"ysugimoto","description":"Serverless framework for Go runtime.","archived":false,"fork":false,"pushed_at":"2019-07-22T04:47:23.000Z","size":1352,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-25T09:41:14.118Z","etag":null,"topics":["aws","aws-apigateway","aws-cloudwatch","aws-lambda","aws-lambda-golang","aws-s3","golang"],"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/ysugimoto.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}},"created_at":"2018-01-30T06:07:55.000Z","updated_at":"2022-03-31T19:43:31.000Z","dependencies_parsed_at":"2022-09-26T18:50:31.433Z","dependency_job_id":null,"html_url":"https://github.com/ysugimoto/ginger","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysugimoto%2Fginger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysugimoto%2Fginger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysugimoto%2Fginger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysugimoto%2Fginger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ysugimoto","download_url":"https://codeload.github.com/ysugimoto/ginger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235388536,"owners_count":18981944,"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","aws-apigateway","aws-cloudwatch","aws-lambda","aws-lambda-golang","aws-s3","golang"],"created_at":"2024-11-25T09:29:19.619Z","updated_at":"2025-01-24T04:57:16.024Z","avatar_url":"https://github.com/ysugimoto.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/ysugimoto/ginger.svg?style=svg)](https://circleci.com/gh/ysugimoto/ginger)\n\n# ginger - Serverless framework for Go runtime\n\n`ginger` is the framework manages `Serverless` architecture for Go runtime.\n\n## Features\n\n`ginger` manages following AWS services:\n\n- `API Gateway` endpoints\n- `S3` storage files\n- `Cloudwatch` schedule events and Lambda function logger\n- `Lambda` __for `go1.x` runtime__\n\n## Requirements\n\n- Go (we recommend latest version)\n- AWS user who has above resource permissions\n\n## Installation\n\nYou can download prebuilt binary at [Release](https://github.com/ysugimoto/ginger/releases).\nBut although you need to install `Go` for compile Lambda function.\n\nTo see a general usage, run `ginger help` command.\n\n## Getting Started\n\n### Setup\n\nRun the `ginger init` command at your project directory:\n\n\n```\ncd /path/to/project\nginger init\n\u003e\u003e\u003e some output...\n```\n\nIf you want to use (probably almost case yes) external Go package, we suggest you should put project directory under the `$GOPATH/src` to enable to detect vendor tree.\n\nFor example:\n\n```\nexport GOPATH=$HOME/go\ncd $HOME/go/src/ginger-project\nginger init\n```\n\n`ginger` wants to input `Lambda execution role` and `S3 storage name`, you should input suitable value.\n\n### Create function\n\nTo create new function, run the `ginger function create --name [function name]` command.\n\n`ginger` creates function structure under the `functions/` directory, and write out to configuration of `Ginger.toml`.\n\n```\nginger function create --name example\n```\n\nYou can find a `functions/example` directory which contains `main.go` and `Function.toml`.\nThe `main.go` is a Lambda function handler. The `github.com/aws/aws-lambda-go/lambda` is installed as default.\nOn the other hand, the `Function.toml` is setting file of Lambda function e.g. memory limit, timeout, and so on.\n\nOf course you can install additional package with `go get` or other verndoring tools like `glide`, `dep`, ...\n\nNote that `ginger function create` creates function only on your local. To work on `AWS Lambda`, you need to `deploy function`.\n\n### Deploy function\n\nAfter you modified a function, run `ginger deploy function` command to deploy to the `AWS Lambda`.\n\n```\nginger deploy function (--name [destination function])\n```\n\n`ginger` compiles function automatically and archive to `zip`, finally send to `AWS` to create on destination region.\n\nOr `ginger function deploy` is alias of this command, so you can also use it to deploy function.\n\n### Invoke function\n\nOnce you deployed function to `AWS`, you can invoke the function via `AWS Lambda`:\n\n```\nginger function invoke --name [function name] --event [event source json]\n```\n\nAn `--event` option indicates event source for input of lambda function handler. `ginger` gets the payload as following options and pass to the function input:\n\n- If option doesn't exists, pass as _empty payload_\n- If option supplied as string, pass as it is\n- If option starts with `@`, like `curl`, ginger tries to load the file and pass its content\n\nAfter invocation end, the result print on your terminal.\n\nTo see in details, run the help command:\n\n```\nginger function help\n```\n\n### Create Resource Endpoint\n\nTo create API endpoint, run the `ginger resource create --path [endpoint path]` command.\n\n`ginger` creates endpoint on `Ginger.toml`.\n\n```\nginger resource create --path /foo/bar\n```\n\nNote that `ginger resource create` creates endpoint info only on your local. To work on `AWS API Gateway`, you need to `deploy api`.\n\n### Deploy api\n\nAfter you created endpoint, run `ginger deploy resource` command to deploy to the `AWS API Gateway`.\n\n```\nginger deploy resource --stage [target stage] (--path [destination path])\n```\n\nCommand creates resouce which we need, and also create root `REST API` if you haven't create it.\n\nif `--stage` option id supplied, ginger tries to create deployment to target stage. Otherwise, only create resources.\n\nNote that the `AWS API Gateway` manages endpoints as `pathpart`, it is part of segment, so we need to create recursively by each segment.\nBut you don't need to care about it because `ginger` creates and manages sub-path automatically and save on `Ginger.toml`.\n\nIn detail, see [AWS API Gateway documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-settings-method-request.html).\n\nOr `ginger resource deploy` is alias of this command, so you can also use it to deploy resources.\n\n### Setup Lambda Integration\n\nThe `AWS API Gateway` supports [Lambda Proxy Integration](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-as-simple-proxy-for-lambda.html), and `ginger` can manage its feature.\n\nTo set up it, run `ginger function mount` command with function name and endpoint option:\n\n```\nginger function mount\n```\n\nThen, `ginger` asks target function and endpoint by choosing list. After select both and deploy api to AWS, proxy integration creates automatically.\nLet's access to API Gateway URL!\n\n### Invoke endpoint\n\nIn default, the `API Gateway` endpoint is complicated a little. So you can invoke HTTP request through `ginger resource invoke` command with `--stage` option to determine invoke stage.\n\n```\nginger resource invoke --stage [stage name]\n```\n\n`ginger` asks path input, make request URI and send HTTP request, and outputs response headers and body.\n\n## API Doc\n\nSee [Command API document](https://github.com/ysugimoto/ginger/blob/master/docs/command.md)\n\n## Examples\n\nNow writing...\n\n## Development\n\nCheckout this project and build locally:\n\n```\ncd $GOPATH\ngo get github.com/ysugimoto/ginger\ncd src/github.com/ysugimoto/ginger\nmake\n```\n\nOn `make` command builds with `debug flag`. This flag dumps stacktrace on error and all AWS SDK requests and responses.\nIt will help you how command processed.\n\nWe welcome your feedbacks and PRs :-)\n\n## License\n\nMIT\n\n## Author\n\nysugimoto (Yoshiaki Sugimoto)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysugimoto%2Fginger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fysugimoto%2Fginger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysugimoto%2Fginger/lists"}