Skip to content

mateuszdyminski/go-template

Repository files navigation

Go-template

TBD

Getting Started

TBD

Features

  • 12-factor app compliant
  • Inteligent health checks (readiness and liveness) - they are checking connection to DB as well
  • Graceful shutdown on interrupt signals
  • Instrumented with Prometheus
  • Structured logging with zap
  • Layered docker builds
  • Multi-stage docker builds
  • Repository for connecting PostgresDB
  • Swagger docs available under /swagger endpoint

Web API

  • GET /version returns information about app version, last commiter, etc
  • GET /metrics returns metrics for prometheus purpose
  • GET /health returns liveness probe
  • GET /ready returns readiness probe
  • GET /swagger.json returns the API Swagger docs, used for Linkerd service profiling and Gloo routes discovery

Prerequisites

You need to have working go environment:

Installing

A step by step series of examples how to get a development env running:

Run docker-compose with all required components:

docker-compose up -d postgres

And run application locally:

make run

Or with docker-compose:

docker-compose up -d application

Now you can go to http://localhost:8080/swagger/ and check whether it's working.

Running the tests

make test

And coding style tests

make lint

Deployment

To build, pack binary into Docker image and push it into dockerhub.com:

make release
kubectl apply -k github.com/mateuszdyminski/go-template/kustomize

Build final binary

make build

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

TBD

License

MIT

Acknowledgments

TBD

About

My private template for Go projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published