{"id":18941543,"url":"https://github.com/mchmarny/cloud-run-jason-parser","last_synced_at":"2026-03-23T21:30:18.776Z","repository":{"id":77051288,"uuid":"207730687","full_name":"mchmarny/cloud-run-jason-parser","owner":"mchmarny","description":"Simple Cloud Run service that parses posted JSON using provided select query and returns matching results.","archived":false,"fork":false,"pushed_at":"2020-01-24T23:36:37.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-10T11:03:50.521Z","etag":null,"topics":["cloudrun","gcp","golang","json","query","service"],"latest_commit_sha":null,"homepage":"https://cloud.run","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mchmarny.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-11T05:30:46.000Z","updated_at":"2024-06-19T12:19:47.011Z","dependencies_parsed_at":null,"dependency_job_id":"8ec601ad-5aa7-4fb1-84e9-8b226eecb7f8","html_url":"https://github.com/mchmarny/cloud-run-jason-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fcloud-run-jason-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fcloud-run-jason-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fcloud-run-jason-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fcloud-run-jason-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mchmarny","download_url":"https://codeload.github.com/mchmarny/cloud-run-jason-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239942756,"owners_count":19722330,"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":["cloudrun","gcp","golang","json","query","service"],"created_at":"2024-11-08T12:28:27.152Z","updated_at":"2026-03-23T21:30:18.700Z","avatar_url":"https://github.com/mchmarny.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cloud-run-jason-parser\n\nSimple [Cloud Run](https://cloud.google.com/run/) service that parses posted JSON using provided select query and returns matching results.\n\nThe currently implemented services are:\n\n* `POST /find` - Returns all matching elements anywhere in the posted content based on provided select query\n* `POST /select` - Selects specific element from the posted content based on a fully-qualified query\n\n## Example\n\nYou can invoke the service using HTTP to select on specific element of that JSON\n\n```shell\ncurl -X POST \\\n     -H \"Select-query: contributions\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"login\": \"test\",\"id\": 123456,\"type\": \"User\",\"contributions\": 551}' \\\n     https://json-selector-2gtouos2pq-uc.a.run.app/select\n```\n\nThe resulting JSON response from the service would be `551`.\n\n## Build the image\n\nStart by [building a container image](bin/image) by submitting job to Cloud Build using the included [Dockerfile](./Dockerfile) and results in versioned, non-root container image URI which will be used to deploy your service to Cloud Run.\n\n```shell\nbin/image\n```\n\n## Create IAM account\n\nIt's a good practice to run Cloud Run service under a specific IAM account. [Create a service account](bin/account) to configure least privilege IAM service account who's identity the deployed Cloud Run service will run under.\n\n```shell\nbin/account\n```\n\n## Deploy Service\n\nFinally [deploy public Cloud Run service](bin/deploy) configured with the previously configured service account identity container image.\n\n```shell\nbin/deploy\n```\n\n## Test\n\nYou can use one of the provided sample files to test your newly deployed service. Start by first capturing the Cloud Run URL\n\n```shell\nexport SERVICE_URL=$(gcloud beta run services describe json-selector \\\n    --region us-central1 \\\n    --format=\"value(status.url)\")\n```\n\nNow you can CURL on that service with the provided sample file which is a result of the GitHub public API query on the [Knative Serving repository](https://github.com/knative/serving) contributors\n\n```shell\ncurl -X POST \\\n     -H \"Select-query: login\" \\\n     -H \"Content-Type: application/json\" \\\n     -d \"@sample/github-repo-contributors.json\" \\\n     \"${SERVICE_URL}/find\"\n```\nThe result should be `test`.\n\n## Cleanup\n\nTo cleanup all resources created by this sample execute\n\n```shell\nbin/cleanup\n```\n\n## Disclaimer\n\nThis is my personal project and it does not represent my employer. I take no responsibility for issues caused by this code. I do my best to ensure that everything works, but if something goes wrong, my apologies is all you will get.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmchmarny%2Fcloud-run-jason-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmchmarny%2Fcloud-run-jason-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmchmarny%2Fcloud-run-jason-parser/lists"}