https://github.com/daniilty/microservice-template-go
Basic microservice template to save you some time
https://github.com/daniilty/microservice-template-go
go golang microservices templates
Last synced: about 2 months ago
JSON representation
Basic microservice template to save you some time
- Host: GitHub
- URL: https://github.com/daniilty/microservice-template-go
- Owner: daniilty
- Created: 2022-02-03T16:40:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-03T17:18:02.000Z (over 4 years ago)
- Last Synced: 2025-01-26T01:20:26.188Z (over 1 year ago)
- Topics: go, golang, microservices, templates
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Microservice template for a Golang application.
## Features
* Prometheus metrics
* HTTP Healthcheck endpoint
* Soon: jaeger tracing
* Soon: GRPC healthcheck
## Configuration
### Add new db pinger:
./internal/mongo.go:
```go
func (m *mongoPinger) Ping(ctx context.Context) {
ctx, _ = context.WithTimeout(ctx, pingTimeout)
return client.Ping(ctx, readpref.Primary())
}
```
./internal/healthcheck/options.go:
```go
func WithMongoPinger(pinger db.Pinger) func(*checker) {
return func(c *checker) {
c.mongoPinger = pinger
}
}
```
## ENV vars:
* `HTTP_DEVOPS_ADDR` - addr for metics/healthcheck methods