{"id":21045317,"url":"https://github.com/psmarcin/events-consumers","last_synced_at":"2026-04-27T19:32:46.451Z","repository":{"id":119217996,"uuid":"231917803","full_name":"psmarcin/events-consumers","owner":"psmarcin","description":"PoC for queues, task scheduler and cloud functions in GCP","archived":false,"fork":false,"pushed_at":"2023-01-01T12:20:50.000Z","size":209,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-28T08:19:28.145Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psmarcin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-01-05T12:59:18.000Z","updated_at":"2023-01-01T11:51:40.000Z","dependencies_parsed_at":"2023-04-30T10:31:19.378Z","dependency_job_id":null,"html_url":"https://github.com/psmarcin/events-consumers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/psmarcin/events-consumers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psmarcin%2Fevents-consumers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psmarcin%2Fevents-consumers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psmarcin%2Fevents-consumers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psmarcin%2Fevents-consumers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psmarcin","download_url":"https://codeload.github.com/psmarcin/events-consumers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psmarcin%2Fevents-consumers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32352396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-19T14:21:30.810Z","updated_at":"2026-04-27T19:32:46.426Z","avatar_url":"https://github.com/psmarcin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Events Consumer \n\n![Unit tests](https://github.com/psmarcin/events-consumers/workflows/Unit%20tests/badge.svg?branch=master)\n\nNotify about content changes. Use Google Cloud Function, Google PubSub, Google Scheduler and Google Firestore to send notification via Telegram about content changes.\n\n#### Battery included\n💻 (code) + 📖 (infrastructure) = ❤️\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.\n\n### Prerequisites\n\n* [Terraform](https://www.terraform.io/downloads.html) - Infrastructure as a code\n* [Go](https://golang.org/dl/) - Function logic\n* [Google Cloud CLI](https://cloud.google.com/sdk/docs/quickstarts/) - Interact with GCP\n\n\n### Installing\n\nA step by step series of examples that tell you how to get a development env running\n\nRun function locally: \n```sh\ncd ./pkg/get-content\ngo run ./cmd/main.go\n```\n\nServer will start listing on http://localhost:8080\n\nMake POST request with event payload: \n```sh\ncurl --location --request POST 'http://localhost:8080' \\\n--header 'Content-Type: text/plain' \\\n--data-binary 'request-payload.json'\n```\n\nExample payload: \n```json\n{\n\t\"data\": \"eyJjb21tYW5kIjogImN1cmwgaHR0cHM6Ly9nb29nbGUuY29tIiwic2VsZWN0b3IiOiAiYm9keSIsImNvbnRlbnQiOiAib2xkIGNvbnRlbnQiLCJuYW1lIjoiam9iIG5hbWUifQo\"\n}\n```\n\n\"data\" should be base64 encoded. So JSON example decoded version looks like this:\n\n```json\n{\n\t\"data\": {\n\t\t\"command\": \"curl https://google.com\",\n\t\t\"selector\": \"body\",\n\t\t\"content\": \"old content\",\n\t\t\"name\":\"job name\"\n\t}\n}\n```\n\n\n\n## Running the tests\n\nTo run local test go to function directory and run `go test ./...`\n\n\n### And coding style tests\n\nTo run test style formatter run `gofmt -s -w ./pkg/`\n\n## Deployment\n\nWe use `terraform` for handling all infrastructure tasks including deployment. \n\n## Deploy\n\nSet `credential.json` file for authorization in GCP: \n```sh\nexport GOOGLE_CLOUD_KEYFILE_JSON=\"./events-consumers/infrastructure/credentials.json\"\n```\n\n\n```shell script\nmake deploy-production\n```\n\n### Config files\n1. `./infrastructure/production.tfvars`:\n```terraform\n# https://www.terraform.io/docs/providers/google/index.html\nproject = \"\"\nregion = \"\"\nzone = \"\"\n# app config\nget_content_name=\"\"\nget_jobs_name=\"\"\ntelegram_api_key=\"\"\ntelegram_channel_id=\"\"\n```\n1. `./infrastructure/development.tfvars`:\n```terraform\n# https://www.terraform.io/docs/providers/google/index.html\nproject = \"\"\nregion = \"\"\nzone = \"\"\n# app config\nget_content_name=\"\"\nget_jobs_name=\"\"\ntelegram_api_key=\"\"\ntelegram_channel_id=\"\"\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsmarcin%2Fevents-consumers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsmarcin%2Fevents-consumers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsmarcin%2Fevents-consumers/lists"}