- Written in Go
- Stores data in PostgreSQL with pgx
git clone https://github.com/cenkayla/userbalance.git
cd userbalance
go run cmd/main.go
To get balance
$ curl 'localhost:8080/users/balance/1'
To add balance
$ curl --request PUT \
--url "localhost:8080/users/balance/add/1?balance=50" \
--header "Content-Type: application/x-www-form-urlencoded" \
To reduce balance
curl --request PUT \
--url "localhost:8080/users/balance/reduce/1?balance=50" \
--header "Content-Type: application/x-www-form-urlencoded" \
To transfer balance
curl --request PUT \
--url "localhost:8080/users/balance/transfer/1?receiver_id=0&balance=20" \
--header "Content-Type: application/x-www-form-urlencoded" \