Develop in Go language a service that will provide an API for retrieval of the Last Traded Price of Bitcoin for the following currency pairs:
- BTC/USD
- BTC/CHF
- BTC/EUR
The request path is: /api/v1/ltp
The response shall constitute JSON of the following structure:
{
"ltp": [
{
"pair": "BTC/CHF",
"amount": "49000.12"
},
{
"pair": "BTC/EUR",
"amount": "50000.12"
},
{
"pair": "BTC/USD",
"amount": "52000.12"
}
]
}
You shall provide time accuracy of the data up to the last minute.
- Code shall be hosted in a remote public repository
- readme.md includes clear steps to build and run the app
- Integration tests
- Dockerized application
The public Kraken API might be used to retrieve the above LTP information API Documentation (The values of the last traded price is called “last trade closed”)
docker build -t service .
docker run -p 80:80 service
go test ./...