usrlocalts / golang_boilerplate

Golang Boilerplate. This is a sample golang boilerplate which actually creates posts given a topic and information.
MIT License
2 stars 1 forks source link

Golang Boilerplate

This is a sample golang boilerplate which actually creates posts given a topic and information.

About this project

This project supports the following integrations:

New Relic monitoring has been done for both API and Postgres DB Response times in this project.

Both New Relic and Sentry can be toggled off by setting the sentry_enabled / new_relic_enabled to false in application.yml.

Technical Components Used

Glide - Package Manager DB - Postgres Log Integration - Sentry App Monitoring - New Relic API Documentation - Swagger/API Blueprint

Migrations

Migrations can be found in migrations directory. This uses github.com/mattes/migrate for running migrations

A Migration can be also rolled back by ./golang_boilerplate rollback

Project Structure

Setup

This service runs on go.

GOPATH=<workspace_dir>
export GOPATH
PATH="${PATH}:${GOPATH}/bin"
export PATH

This does the following things:

This task is idempotent

Test

make test

Start Server

./golang_boilerplate start

Test API

curl http://localhost:3000/ping

Other API details can be found in api_blueprints directory

Tasks Glossary

make setup - Sets up the project make test - Recreates Test Database, Runs Migration against the Test DB, Runs Test Case make compile - Builds the Codebase make test-coverage - Runs test cases and computes coverage make db.migrate - Runs Migration make copy-config - Copies application.yml.sample to application.yml

Please refer the Makefile for the entire tasks list