{"id":16021446,"url":"https://github.com/jdelobel/go-api","last_synced_at":"2026-05-04T10:35:00.365Z","repository":{"id":69313904,"uuid":"94756087","full_name":"jdelobel/go-api","owner":"jdelobel","description":null,"archived":false,"fork":false,"pushed_at":"2017-09-12T09:30:48.000Z","size":494,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-26T02:05:21.357Z","etag":null,"topics":["api","docker","gelf","go-application","golang","graylog","health-check","jenkins","postgresql","prometheus","rabbitmq","swagger"],"latest_commit_sha":null,"homepage":null,"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/jdelobel.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":"2017-06-19T08:50:44.000Z","updated_at":"2017-07-01T00:16:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"afdf327a-e93d-4bf3-8003-87febd2fac6a","html_url":"https://github.com/jdelobel/go-api","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"aeb6ee450fad762c83f41e75cc9bb7770afb45ae"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jdelobel/go-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdelobel%2Fgo-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdelobel%2Fgo-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdelobel%2Fgo-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdelobel%2Fgo-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdelobel","download_url":"https://codeload.github.com/jdelobel/go-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdelobel%2Fgo-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32604444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"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":["api","docker","gelf","go-application","golang","graylog","health-check","jenkins","postgresql","prometheus","rabbitmq","swagger"],"created_at":"2024-10-08T18:04:20.037Z","updated_at":"2026-05-04T10:35:00.336Z","avatar_url":"https://github.com/jdelobel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-api\n\n## Description\n\nThis project is based on https://github.com/ardanlabs/gotraining/blob/master/starter-kits/http.\nIt uses postgresql to persist data.\n\n## Install dependencies\n\n```sh\n$ go get ./...\n```\n\n## Launch Docker containers (postgres)\n\nYou have to launch docker-compose in order to have all the required components up and running:\n\n```sh\n$ docker-compose up -d\n```\n\n## Build and run\n\n```sh\n$ go build ./cmd/apid\n$ ./apid\n```\n\n## Database migrations\n\nMigration use cli tool [migrate](https://github.com/mattes/migrate).\n\n### Cli installation\n\n```sh\n$ go get -u -d github.com/mattes/migrate/cli github.com/lib/pq\n$ go build -tags 'postgres' -o /usr/local/bin/migrate github.com/mattes/migrate/cli\n```\n\n### Example\n\n#### Create sql migrations files\n\n```sh\n$ migrate -database \"postgres://go-api-postgres:go-api-postgres@localhost:5432/go-api-postgres?x-migrations-table=migrations\" create -ext sql -dir migrations create_images\n```\n\n#### Exec migrations\n\n```sh\n$ migrate -source=file://migrations -database \"postgres://go-api-postgres:go-api-postgres@localhost:5432/go-api-postgres?sslmode=disable\" up\n```\n\n#### Rollback migrations\n\n```sh\n$ migrate -source=file://migrations -database \"postgres://go-api-postgres:go-api-postgres@localhost:5432/go-api-postgres?sslmode=disable\" down\n```\n\n## Swagger API documentation\n\nYou can access to the swagger API documentation at: http://[HOST][PORT]:3000/swagger/api-docs/\n\n## Build Docker image from source\n\n```sh\n$ compile=CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo ./cmd/apid/\n$ docker build -t go-api .\n```\n\n## Run Docker image\n\n```sh\n$ docker run --name go-api -e CONFIGOR_APPHOST=0.0.0.0 -e CONFIGOR_DATABASE_HOST=go-api-postgres --link go-api-postgres:go-api-postgres -p 3000:3000 -d go-api\n```\n\n## TODO\n\n- [x] Migrations\n- [x] Logger (Graylog)\n- [ ] Make tests\n- [x] Config (configor)\n- [x] Swagger docs\n- [x] Use sqlx instead of sql (structScan)\n- [x] Health and readiness\n- [ ] Prometheus metrics\n- [x] Communicate with RabbitMQ\n- [x] Dockerfile (and docker-compose)\n- [ ] Jenkins integration\n- [ ] govendor (production needs)\n\nThanks to contribute to this project. Each TODO must be done in a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdelobel%2Fgo-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdelobel%2Fgo-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdelobel%2Fgo-api/lists"}