Skip to content

daniilty/microservice-template-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

func (m *mongoPinger) Ping(ctx context.Context) {
  ctx, _ = context.WithTimeout(ctx, pingTimeout)
  
  return client.Ping(ctx, readpref.Primary())
}

./internal/healthcheck/options.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

About

Basic microservice template to save you some time

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published