- Install Docker, if you don't already have it. For packages and instructions, see the Docker installation documentation
- Install go, if you don't already have it. For versions and instructions, see the Download and install documentation
-
Setup the database
Run the following makefile target:
make start-database
-
Build the application
Run the following makefile target to generate a binary named
appmake build
Run the application in your terminal as below:
./app -queryParams query_params.csv -goroutineCount 2There are additional flags you can pass to the application, the full list is below:
| Name | Default | Type | Description |
|---|---|---|---|
| queryParams | query_params.csv | string | Path to the input csv |
| verbose | false | bool | Enable verbose logging |
| goroutineCount | 2 | int | The number of goroutines to use |
| dbHost | localhost | string | The database host |
| dbName | homework | string | The database name |
| dbUser | postgres | string | The database user |
| dbPassword | password | string | The database password |
| dbSSLMode | disable | string | The database sslmode |
Run the following makefile target to runs the tests:
make test
Run the following makefile target to stop the database:
make stop-database