Goboiler is my personal golang boilerplate for services & APIs. It uses the following packages:
- sqlx and sqalx for database access.
- gin for the http router.
- zerolog for logging.
- tern for database migrations.
- task as a makefile replacement.
- prometheus for metrics.
- Clone the repository
git clone github.com/arthureichelberger/goboiler
- Install dependencies
task install
- Start the associated services
docker-compose up -d
- Run the migrations
task migrate:fresh
- Run the server
task run
task run
task test # also resets the database
task lint
task migrate:up # to run the next migrations
task migrate:down # to revert the database
task migrate:fresh # to revert the database and run all the migrations
task migrate:new -- {{migration_name}} # ex: create_users_table
task docker:package
This boilerplate is mainly designed for deployment in Kubernetes with a PostgreSQL database. Therefore, certain technical decisions were made, particularly regarding liveness and readiness probes.