{"id":18355150,"url":"https://github.com/flowup/cloudfunc","last_synced_at":"2025-04-06T12:31:56.455Z","repository":{"id":90369101,"uuid":"96911765","full_name":"flowup/cloudfunc","owner":"flowup","description":"deploying Google Cloud Functions written in Golang with ease","archived":false,"fork":false,"pushed_at":"2019-05-09T15:26:03.000Z","size":27,"stargazers_count":97,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-21T23:51:13.486Z","etag":null,"topics":["cloud-functions","gcloud","golang","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/flowup.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":"2017-07-11T16:01:55.000Z","updated_at":"2023-04-05T07:51:58.000Z","dependencies_parsed_at":"2023-06-18T04:46:44.158Z","dependency_job_id":null,"html_url":"https://github.com/flowup/cloudfunc","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/flowup%2Fcloudfunc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowup%2Fcloudfunc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowup%2Fcloudfunc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowup%2Fcloudfunc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flowup","download_url":"https://codeload.github.com/flowup/cloudfunc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247484333,"owners_count":20946384,"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":["cloud-functions","gcloud","golang","serverless"],"created_at":"2024-11-05T22:06:08.439Z","updated_at":"2025-04-06T12:31:56.192Z","avatar_url":"https://github.com/flowup.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CloudFunc\n\n[![GoDoc](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/github.com/flowup/cloudfunc/api)\n![](https://img.shields.io/badge/license-MIT-blue.svg)\n\nCloudFunc is a command line tool (cli) that deploys [Google Cloud Functions](https://cloud.google.com/functions/) with ease.\nIt uses node.js shim to wrap the Go binary as the Cloud Functions only support Node at the moment.\n\n\u003e Only us-central region is supported while Google Cloud Functions are in Beta\n\n## Installation\n\n\u003e Tested on Golang 1.8\n\nPlease follow [gcloud sdk](https://cloud.google.com/sdk/downloads) installation notes in case you don't have the `gcloud` command.\n\nYou will also need to update and install beta features at the moment\n```\ngcloud components update \u0026\u0026\ngcloud components install beta\n```\n\nFinally download the `cloudfunc` with its SDK\n```\ngo get -u github.com/flowup/cloudfunc/...\n```\n\n## Code Example\n\nThis code example shows a simple cloud function that sends back whatever JSON it receives.\n\n```go\npackage main\n\nimport (\n\t\"github.com/flowup/cloudfunc/api\"\n)\n\nfunc main() {\n\tvar input map[string]interface{} = make(map[string]interface{})\n\t\n\tcloudFunction := api.NewCloudFunc()\n\treq, err := cloudFunction.GetRequest()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t\n\terr = req.BindBody(\u0026input)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcloudFunction.SendResponse(\u0026input)\n}\n\n```\n\n## Usage\n\nSingle `deploy` command is exposed by the `cloudfunc`. This allows to target a folder with `main` package that will be\ndeployed to cloud functions. Name of the function will be derived from the name of the folder.\n\n\u003e You need to also target the storage bucket that will be used to store contents of your function\n\n```\ncloudfunc deploy myfunction --bucket mybucket\n```\n\nWhere:\n- `myfunction` is the folder with your function\n- `mybucket` is the name of your gcloud bucket\n\n## Configuration\n\nAdditional configurations can be done using `function.json` file within your function `main` package (look at the `/examples` folder).\n\n```\n{\n  \"name\": \"myfunctionname\",\n  \"bucket\": \"mybucketname\",\n  \"memory\": 128,\n  \"timeout\": 3\n}\n```\n\nIn case your bucket is specified within the `function.json` file, you can simply deploy with:\n\n```\ncloudfunc deploy example # where example is your function folder\n```\n\n## SDK\n\nThere are two IO functions provided by `github.com/flowup/cloudfunc/api`:\n\n```go\n// GetInput accepts an interface and unmarshalls the function input using json.Unmarshal\nfunc GetInput(i interface{}) error {}\n```\n\n\n```go\n// Send marshalls given interface using json.Marshal and sends it back as a function output\n// If the interface can't be serialized, it will be returned as a pure string\nfunc Send(i interface{}) error\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowup%2Fcloudfunc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflowup%2Fcloudfunc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowup%2Fcloudfunc/lists"}