{"id":24522741,"url":"https://github.com/gbzarelli/pgen","last_synced_at":"2026-05-17T12:32:04.515Z","repository":{"id":45328652,"uuid":"437429309","full_name":"gbzarelli/pgen","owner":"gbzarelli","description":"[GO] PGen is a microservice that generates random and unrepeatable protocols with easy readability.","archived":false,"fork":false,"pushed_at":"2021-12-20T22:04:09.000Z","size":34,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T13:24:36.764Z","etag":null,"topics":["go","go-api","go-gin","go-prometheus","go-redis","golang","redis"],"latest_commit_sha":null,"homepage":"","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/gbzarelli.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":"2021-12-12T01:46:59.000Z","updated_at":"2021-12-20T22:14:10.000Z","dependencies_parsed_at":"2022-09-16T11:50:37.171Z","dependency_job_id":null,"html_url":"https://github.com/gbzarelli/pgen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gbzarelli/pgen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbzarelli%2Fpgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbzarelli%2Fpgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbzarelli%2Fpgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbzarelli%2Fpgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbzarelli","download_url":"https://codeload.github.com/gbzarelli/pgen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbzarelli%2Fpgen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33138263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"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":["go","go-api","go-gin","go-prometheus","go-redis","golang","redis"],"created_at":"2025-01-22T03:35:25.669Z","updated_at":"2026-05-17T12:32:04.499Z","avatar_url":"https://github.com/gbzarelli.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Issues](https://img.shields.io/github/issues/gbzarelli/pgen.svg)\n![Forks](https://img.shields.io/github/forks/gbzarelli/pgen.svg)\n![Stars](https://img.shields.io/github/stars/gbzarelli/pgen.svg)\n![Release Version](https://img.shields.io/github/release/gbzarelli/pgen.svg)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/326bae7f15244e488de6d8aaa94ae17b)](https://www.codacy.com/gh/gbzarelli/pgen/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=gbzarelli/pgen\u0026amp;utm_campaign=Badge_Grade)\n\n# PGen (building... learning GO Lang...)\n\nUnrepeatable Protocol generator API in GO.\n\nThe PGen is a microservice created to generate service protocols for any type of services.\nThese protocols are readable so that people can easily record\n\nThe protocol number consists of 16 digits (by default), the first 8 (fixed) being the current date\nand the last (configurable) random:\n\n\tFormat: 'YYYYMMDD????????' sample: 2021120912345678\n\n# Technologies\n\n- [Gin - Go Web Framework](https://github.com/gin-gonic/gin)\n- [Redis - KV NoSQL for Cache](https://github.com/go-redis)\n- [Testify - Asserts and Mocks](https://github.com/stretchr/testify)\n- [Metrics - GinProm by Depado](https://github.com/Depado/ginprom)\n\n# Instructions to Run\n\n### Prepare\n\n- Clone de project:\n  - `git@github.com:gbzarelli/pgen.git`\n- Go to `pgen` directory:\n  - `$cd pgen/`\n- Build project\n  - Prepare dependencies\n    - `$make dependencies`\n  - Build project\n    - `$make build`\n\n### Run with Docker\n\n- Generate Dockerfile\n  - `$make build-docker`\n- Run full stack:\n  - `$make run-docker-compose`\n\n### Run in project\n\n- Run the dependencies (infra / redis):\n  - `$make run-docker-stack`\n- Run project\n  - `$go run main.go`\n\n### Envs\n\nCustom the decimal places value to generate a new protocol (default 8):\n- `PROTOCOL_DECIMAL_PLACES_AFTER_DATE`\n  - Default in Project and Dockerfile: 8\n\nCustom Redis address:\n- `REDIS_ADDRESS`\n  - Default in Project: localhost:6379\n  - Default in Dockerfile: redis:6379\n\n## API\n\nThe project starts in `localhost:5000` with a unique endpoint to generate a new protocol:\n\n## Endpoint: v1/protocol\n\n#### Request:\n\n```shell\ncurl --request POST --url http://localhost:5000/v1/protocol\n```\n\n#### Response:\n\n```json\n201 {\"protocol\": \"2021121204066844\"}\n```\n\n## Metrics by prometheus\n\n#### View metrics by app\n\n```shell\ncurl --request GET --url http://localhost:5000/metrics\n```\n\n#### Prometheus\n\nIf you run by docker just open prometheus in: `http://localhost:9090/`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbzarelli%2Fpgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbzarelli%2Fpgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbzarelli%2Fpgen/lists"}