- Docker >= 20.10
Clone the repository
git clone https://github.com/BagardHugo/GoFinalProject.git
You need to install docker first. Docker is available on linux and MacOs and Windows ( using Docker Desktop).
docker-compose up
This command will create 3 docker container
- database
- Api
- Mock external Api
If you need to stop the containers:
docker-compose down
The endpoint is exposed on the port 5001 :
http://localhost:5001/
The only method supported is POST
Header to provide :
Content-Type : application/json
Example of body :
{
"username" : "Hugo",
"password" : "myComplexPassword",
"pin_code" : "123456"
}
This endpoint will successfully respond with a body like :
{
"Id": 1,
"username": "hugo",
"password": "myComplexPassword",
"pincode": "123456",
"account": {
"id": 1,
"wallet_address": "829beafe-96c7-46dd-ae5f-0d35858dda8b",
"currency_code": "ETH",
"currency_balance": "0"
}
}
This endpoint will respond with an error body like :
{
"error": "The error message"
}
For run unit test, execute command :
go test -v
For run benchmark test, execute command :
go test -bench .
No copyright for this project :)