Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/pinebit/go-boilerplate

Golang server boilerplate
https://github.com/pinebit/go-boilerplate

boilerplate boilerplate-template golang server

Last synced: 10 days ago
JSON representation

Golang server boilerplate

Awesome Lists containing this project

README

        

# go-boilerplate

[![Go](https://github.com/pinebit/go-boilerplate/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/pinebit/go-boilerplate/actions/workflows/go.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Docker Image](https://github.com/pinebit/go-boilerplate/actions/workflows/docker-image.yml/badge.svg?branch=main)](https://github.com/pinebit/go-boilerplate/actions/workflows/docker-image.yml)

Golang server boilerplate.

## Motivation

To create a battle-tested server template that implements the most common best practices.

## Features

* Dockerfile
* TOML configuration with [go-toml](https://github.com/pelletier/go-toml)
* Structured logging with [zap](https://github.com/uber-go/zap)
* Graceful boot/shutdown with [go-boot](https://github.com/pinebit/go-boot)
* [Prometheus](https://github.com/prometheus/client_golang) metrics
* Simple HTTP server with [gin framework](https://github.com/gin-gonic/gin)
* Dependency injection with [dig](https://github.com/uber-go/dig)

## Usage

1. Find and replace all "boilerplate" words for your product.
2. Building: `docker build .` or `make build`
3. Testing: `make test` and `make lint`
4. Running: `make run` or simply `go run .`