Simple Todo list Go server. Uses Go and PostgreSQL
See openapi.yaml
.
Install golangci-lint:
brew install golangci-lint
You will need psql binary. On MacOS install it via homebrew:
brew install libpq
# install build and development dependencies
make prepare
# build app
make
The following command will create and run detached Docker containers running a PostgreSQL database with an Adminer instance
# start containers
docker compose up -d
# setup database
make reset-db
# start server
make run-server
# shutdown
docker compose down
When the local PostgreSQL database is empty or brand new, run the following script to create the schema:
docker-compose up -d
make reset-db
tern -m database/iban/migrations new <name>
make migrate-up
# migrate one version up
tern migrate -c database/migrations/tern.conf -m database/migrations -d +1
# migrate one version down
tern migrate -c database/migrations/tern.conf -m database/migrations -d -1
# migrate one version up again
tern migrate -c database/migrations/tern.conf -m database/migrations -d +1
If no error occurred, then the migration is fine.
No setup required.
make unit
Requires a full local setup.
docker-compose up -d
make integration