- REST API
- PostgreSQL
- Migrations
- Logger
- Tests
- Docker
- GolangCI-lint
- Development with Hot-Reload
cp .env.sample .env
make docker-dev-up # default listen on localhost:8080
make docker-test-up
make test
Method | URL | Description |
---|---|---|
GET | /products | Return all products |
POST | /products | Create new product (use JSON body) |
GET | /products/{id} | Get product by id |
POST | /products/{id} | Update product by id (use JSON body) |
DELETE | /products/{id} | Delete product by id |
make server-run
- Run server with .env configmake docker-dev-up
- Run development environment and hot reload servermake docker-test-up
- Run test environmentmake create-migration name={your_name}
- Create migration in dir/migrations
make generate
- Generate mocks interfacesmake code
- Runcode-style && code-lint
make code-style
- Rungoimports
make code-lint
- Rungolangci-lint
make test
- Run unit + integrations tests (with docker)make unit-test
- Run unit testsmake cover
- Open testcoverage.out
(use aftermake test
)make psql
- Open postgres command line with development db
- github.com/joho/godotenv
- github.com/gorilla/mux
- github.com/jackc/pgx/v4
- go.uber.org/zap
- github.com/stretchr/testify
- github.com/golang/mock
- Cache
- Auth
- Tests with Postman
- Metrics (go / pgx)
MIT