- PostgreSQL - PostgreSQL Database
- Redis - Redis
- labstack/echo - Web Framework
- spf13/viper - Config Reader
- ozzo-validation - Go Struct and Field validation
- testify - A toolkit with common assertions
- sqlmock - Mocking SQL Database
This app required 2 database connection
# run postgreSQL
docker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=api_movie postgres
# run redis
docker run -d -p 6379:6379 redis --requirepass "masukredis"
Run below command to run test, and make sure that all tests are passing
go test -v ./...
- Copy config.example.yaml to config.yaml and fill the config
AppVersion:
Server:
Port: :
Development:
ReadTimeout:
WriteTimeout:
Postgres:
Host:
Port:
User:
Password:
DbName:
Redis:
Host:
Port:
Password:
- Runing app docker-compose.yaml
make docker-compose
or
$ docker docker-compose up -d --build
- After run this, don't forget to check all container are successfully started