{"id":22131110,"url":"https://github.com/slamdev/golang-http-service","last_synced_at":"2025-07-25T18:32:52.442Z","repository":{"id":47600307,"uuid":"301098346","full_name":"slamdev/golang-http-service","owner":"slamdev","description":"Template for creating HTTP service","archived":false,"fork":false,"pushed_at":"2024-04-29T16:46:17.000Z","size":306,"stargazers_count":4,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T13:11:11.608Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"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/slamdev.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":"2020-10-04T10:17:40.000Z","updated_at":"2024-04-29T16:46:21.000Z","dependencies_parsed_at":"2023-12-15T06:31:43.206Z","dependency_job_id":"9b396a36-99ff-4934-815f-933875a59fda","html_url":"https://github.com/slamdev/golang-http-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/slamdev/golang-http-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slamdev%2Fgolang-http-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slamdev%2Fgolang-http-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slamdev%2Fgolang-http-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slamdev%2Fgolang-http-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slamdev","download_url":"https://codeload.github.com/slamdev/golang-http-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slamdev%2Fgolang-http-service/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267046128,"owners_count":24026897,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-12-01T18:29:56.747Z","updated_at":"2025-07-25T18:32:52.114Z","avatar_url":"https://github.com/slamdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# golang-http-service\n\nTemplate for creating HTTP service\n\n## Components\n\n### HTTP API\n\nAPI is defined in [OpenAPI 3](https://swagger.io/specification/v3/) format in the [openapi.yaml](api/openapi.yaml) file.\nDTOs and service interface code is generated using [oapi-codegen](https://github.com/deepmap/oapi-codegen).\n\n### HTTP server\n\n[Echo](https://echo.labstack.com/) framework is used to manage routes. API generator has a nice integration with this\nframework.\n\n### Configuration\n\nApplication configuration is defined [application.yaml](configs/application.yaml) file. There is **profiles** system\nthat allows to use and merge multiple configuration files together. It is controlled with **ACTIVE_PROFILES**\nenvironment variable. E.g.: `ACTIVE_PROFILES=cloud,dev` will merge these files together:\n\n1. application.yaml\n2. application-cloud.yaml\n3. application-dev.yaml\n\n[Uber config](https://github.com/uber-go/config) library is used to parse and merge config files. It also supports\nenvironment variables.\n\nConfiguration files are embedded into the resulting binary with [go embed](https://pkg.go.dev/embed).\n\nAdditionally you can add more configuration files from filesystem by defining `APP_CONFIG_ADDITIONAL_LOCATION` env\nvariable. In this case the app will recursively search for `application.yaml` files in that location.\n\n### Observability\n\n[Zap](https://github.com/uber-go/zap) is used to control logs. Logs are outputted in plain text format when the\napplication is running locally and in json format when the **cloud** profile is used.\n\nApplication exposes [Prometheus](https://prometheus.io/) metrics at **/metrics** endpoint. List of metrics includes\nbasic http stats collected via [Echo Prometheus](https://github.com/labstack/echo-contrib/tree/master/prometheus)\nlibrary.\n\nApplication exposes health endpoint at **/health**.\n\nBoth prometheus and health endpoints are served on a separate port to make sure it is not exposed to outside world.\n\n### Testing\n\nFor reach assertions the [testify](https://github.com/stretchr/testify) library is used. Mock are generated via\n[golang mock](https://github.com/golang/mock) tool.\n\n### Linting\n\n[vacuum](https://github.com/daveshanley/vacuum/) is used to lint OpenAPI files and\n[golangci-lint](https://github.com/golangci/golangci-lint) for Go files.\n\n### Building\n\nAll the build process is describe it the (Makefile)[Makefile]. Run `make build` to test and build the binary.\n\n## Deployment\n\nApplication is distributed via docker container + helm chart. [skaffold](https://skaffold.dev/) is used to build\nand push docker container (with docker-less [ko-build](https://github.com/ko-build/ko)) as well as to package and deploy\nhelm chart.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslamdev%2Fgolang-http-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslamdev%2Fgolang-http-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslamdev%2Fgolang-http-service/lists"}