{"id":31833364,"url":"https://github.com/santos95mat/go-microservice-token","last_synced_at":"2026-04-10T22:41:13.240Z","repository":{"id":206547068,"uuid":"717056340","full_name":"santos95mat/go-microservice-token","owner":"santos95mat","description":"Microserviço de criação e validação de Token por email.","archived":false,"fork":false,"pushed_at":"2023-12-04T15:31:41.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-10T22:40:11.228Z","etag":null,"topics":["docker","email-sender","fiber","go","gorm","postgresql","token"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/santos95mat.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":"2023-11-10T13:08:14.000Z","updated_at":"2023-12-01T12:31:44.000Z","dependencies_parsed_at":"2024-06-21T19:12:25.613Z","dependency_job_id":"d20e3081-50a4-4a4f-a21f-fdfbe0c407b3","html_url":"https://github.com/santos95mat/go-microservice-token","commit_stats":null,"previous_names":["santos95mat/go-microservice-token"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/santos95mat/go-microservice-token","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santos95mat%2Fgo-microservice-token","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santos95mat%2Fgo-microservice-token/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santos95mat%2Fgo-microservice-token/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santos95mat%2Fgo-microservice-token/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/santos95mat","download_url":"https://codeload.github.com/santos95mat/go-microservice-token/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santos95mat%2Fgo-microservice-token/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31662169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"ssl_error","status_checked_at":"2026-04-10T17:19:13.364Z","response_time":98,"last_error":"SSL_read: 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":["docker","email-sender","fiber","go","gorm","postgresql","token"],"created_at":"2025-10-11T23:54:44.132Z","updated_at":"2026-04-10T22:41:13.224Z","avatar_url":"https://github.com/santos95mat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-microservice-token \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/go/go-original.svg\" height=\"48px\" /\u003e\n\n## Gerador e validador de Token para um determinado usuário.\n\n#### - Para construção deste microservice foram seguidos os padrões de SOLID\n#### - usado GORM para conectar ao banco de dados\n#### - banco de dados Postgres\n#### - usado Fiber para criação do microservice\n\n\n## .ENV\n\n#### Para conseguir rodar a aplicação sem erros, você deve criar o arquivo .env com as seguintes variáveis\n\n```\n# Porta onde a API vai rodar como mostra o exemplo abaixo\nPORT=3000\n\n# URL de conexão com o banco de dados como mostra o exemplo abaixo\nDB_URL=\"host=localhost user=postgres password=admin dbname=postgres port=5432 sslmode=disable\"\n```\n\n\n## Rodando a aplicação\n\n```bash\n# baixar todas as dependencias do microservice\n$ go mod tidy\n\n# rodar a migrate primeiro para criação da entidade no banco de dados\n$ go run cmd/migrate/main.go\n\n# start\n$ go run cmd/api/main.go\n```\n\n## JSON\n\n#### Para criar um Token você deve mandar no body um JSON com a seguinte informação\n##### - Se o id informado não for um uuid um erro será gerado\n##### - email para onde o token será enviado\n##### - validation é a validade do token em minutos\n\n```JSON\n{\n  \"user_id\": \"4cb16abd-be70-420d-82af-ecbf21c133a0\",\n  \"email\" : \"email@email.com\",\n  \"validation\": 10\n}\n```\n\n#### Para Validar o Token gerado você deve mandar no body um JSON com as seguintes informações\n```JSON\n{\n  \"user_id\": \"4cb16abd-be70-420d-82af-ecbf21c133a0\",\n  \"token\": \"$r5D\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantos95mat%2Fgo-microservice-token","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsantos95mat%2Fgo-microservice-token","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantos95mat%2Fgo-microservice-token/lists"}