This is a sample golang boilerplate which actually creates posts given a topic and information.
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.
Glide - Package Manager DB - Postgres Log Integration - Sentry App Monitoring - New Relic API Documentation - Swagger/API Blueprint
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
ping
and notfound
can be found in handler
package errors
package. testutil
packagedb
packagehttps://github.com/gojek-engineering/goconfig
which abstracts the way configs are read from application.yml
This service runs on go.
brew install go
.go
is in your shell's path.<workspace_dir>
is the directory in
which you'll checkout your code)GOPATH=<workspace_dir>
export GOPATH
PATH="${PATH}:${GOPATH}/bin"
export PATH
make setup
This does the following things:
This task is idempotent
make test
./golang_boilerplate start
curl http://localhost:3000/ping
Other API details can be found in api_blueprints
directory
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