REST API приложение, которое работает с базой данных и позволяет управлять балансом электронного кошелька.
- Ubuntu (Linux)
- Make
- Go 1.12.1+
- Docker
- k6 for testing
docker pull ghcr.io/fey/wallets_api:latestStart:
docker run \
--rm \
--name wallets_api \
-p 8080:8080 \
-v ($pwd)/path/to/config:/app/config.env
ghcr.io/fey/wallets_apiFor Docker Compose see Makefile
curl localhost:8080/api/v1/wallets/550e8400-e29b-41d4-a716-446655440000Response:
{"wallet_id":"550e8400-e29b-41d4-a716-446655440000","balance":1100}Deposit:
curl -X POST http://localhost:8080/api/v1/wallets -H "Content-Type: application/json" -d '{
"walletId": "550e8400-e29b-41d4-a716-446655440000",
"operationType": "DEPOSIT",
"amount": 1000
}'Withdraw:
curl -X POST http://localhost:8080/api/v1/wallets -H "Content-Type: application/json" -d '{
"walletId": "550e8400-e29b-41d4-a716-446655440000",
"operationType": "WITHDRAW",
"amount": 1000
}'Response:
{"wallet_id":"550e8400-e29b-41d4-a716-446655440000","balance":2100}For more see swagger.yaml or <app_url>/swagger/index.html