An open API service indexing awesome lists of open source software.

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

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