Simple rest API for toggle backend test
- Go 1.18
- Docker
- Docker-compose
- cosmtrek/air
- swaggo/swag
- momaek/formattag
- golang-migrate/migrate
- GNU Make
- githook
git config core.hooksPath .githooks
- cosmtrek/air
go install github.com/cosmtrek/air@latest
- swaggo/swag
go install github.com/swaggo/swag/cmd/swag@latest
- momaek/formattag
go install github.com/momaek/formattag@latest
- golang-migrate/migrate
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
- GNU Make (on windows need chocolatey) Make is on linux by default
choco install make
- Install dependencies
make install
- Create Migration
migrate create -seq -ext sql -dir migrations [name] or
make migration [name]
- Migration Up
make migrate
- Migration Down
make migrate-down
- Runing
make updb
make migrate
make down
make up