{"id":17219475,"url":"https://github.com/kelindar/metering","last_synced_at":"2025-03-25T14:42:15.208Z","repository":{"id":80099569,"uuid":"102244146","full_name":"kelindar/metering","owner":"kelindar","description":"This metering plugin for emitter.io broker persists usage in Google Datastore.","archived":false,"fork":false,"pushed_at":"2017-09-07T14:38:17.000Z","size":896,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T01:45:47.348Z","etag":null,"topics":["datastore","emitter-io","plugin","pubsub"],"latest_commit_sha":null,"homepage":null,"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/kelindar.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-09-03T05:51:28.000Z","updated_at":"2017-09-07T14:39:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"e504c0c2-9826-4d7d-b337-e80fac0d4250","html_url":"https://github.com/kelindar/metering","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/kelindar%2Fmetering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelindar%2Fmetering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelindar%2Fmetering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelindar%2Fmetering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kelindar","download_url":"https://codeload.github.com/kelindar/metering/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245484856,"owners_count":20623156,"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":["datastore","emitter-io","plugin","pubsub"],"created_at":"2024-10-15T03:49:57.326Z","updated_at":"2025-03-25T14:42:15.181Z","avatar_url":"https://github.com/kelindar.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metering with Google Datastore\n\nThis plugin implements [emitter.io](https://emitter.io) `Metering` interface. The usage statistics are written to Google Datastore as descendants of `contract` kind, in `MM/YYYY` format. The counters are incremented using Google Datastore transactions which allows multiple brokers increment counters concurrently. Note that this is intended for demonstration purposes and has not yet been tested in production.\n\n## Usage\n\nIn order to use this plugin, you'd need to first build it (`go build -buildmode=plugin`) after this, launch the broker and point `metering` provider to the `.so` file generated, as in the example below.\n\n```\n{\n\t\"listen\": \":8080\",\n\t\"license\": \"....\",\n\t\"cluster\": {\n\t\t\"name\": \"00:00:00:00:00:01\",\n\t\t\"listen\": \":4000\",\n\t\t\"advertise\": \"127.0.0.1:4000\",\n\t\t\"passphrase\": \"emitter-io\"\n\t},\n\t\"metering\": {\n\t\t\"provider\": \"/mnt/d/Workspace/Go/src/github.com/kelindar/plugins/metering/metering.so\",\n\t\t\"config\": {\n\t\t\t\"type\": \"service_account\",\n\t\t\t\"project_id\": \"your project\",\n\t\t\t\"private_key_id\": \"....\",\n\t\t\t\"private_key\": \"-----BEGIN PRIVATE KEY-----.....\",\n\t\t\t\"client_email\": \".....@appspot.gserviceaccount.com\",\n\t\t\t\"client_id\": \".....\",\n\t\t\t\"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n\t\t\t\"token_uri\": \"https://accounts.google.com/o/oauth2/token\",\n\t\t\t\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n\t\t\t\"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/emitter-io%40appspot.gserviceaccount.com\"\n\t\t}\n\t}\n}\n```\n\nThe `config` is actually Google Serivice Account credentials JSON file. The plugin will copy this in a separate `creds.json` file and provide it to the Google Cloud client internally. For more info, see: https://developers.google.com/identity/protocols/application-default-credentials.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkelindar%2Fmetering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkelindar%2Fmetering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkelindar%2Fmetering/lists"}