https://github.com/slamdev/golang-grpc-service
Template for creating GRPC service
https://github.com/slamdev/golang-grpc-service
Last synced: 3 months ago
JSON representation
Template for creating GRPC service
- Host: GitHub
- URL: https://github.com/slamdev/golang-grpc-service
- Owner: slamdev
- License: apache-2.0
- Created: 2020-11-01T15:56:46.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T08:40:14.000Z (about 2 years ago)
- Last Synced: 2025-01-29T14:45:17.930Z (about 1 year ago)
- Language: Go
- Size: 29.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# golang-http-service
Template for creating GRPC service
## Components
### Configuration
Application configuration is defined [application.yaml](configs/application.yaml) file. There is **profiles** system that
allows to use and merge multiple configuration files together. It is controlled with **ACTIVE_PROFILES** environment
variable. E.g.: `ACTIVE_PROFILES=cloud,dev` will merge these files together:
1. application.yaml
2. application-cloud.yaml
3. application-dev.yaml
[Uber config](https://github.com/uber-go/config) library is used to parse and merge config files. It also supports
environment variables.
Configuration files are embedded into the resulting binary with [pkger](https://github.com/markbates/pkger) tool.
### Monitoring
[Zap](https://github.com/uber-go/zap) is used to control logs. Logs are outputted in plain text format when the
application is running locally and in json format when the **cloud** profile is used.
Application exposes [Prometheus](https://prometheus.io/) metrics at **/metrics** endpoint.
Application exposes health endpoint at **/health**.
### Testing
For reach assertions the [testify](https://github.com/stretchr/testify) library is used.
### Linting
[Spectral](https://github.com/stoplightio/spectral) is used to lint OpenAPI files and
[golangci-lint](https://github.com/golangci/golangci-lint) for Go files.
### Building
All the build process is describe it the (Makefile)[Makefile]. Run `make build` to test and build the binary.