Skip to content

Basic user balance service for learning purposes.

Notifications You must be signed in to change notification settings

cenkayla/userbalance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User balance service

  • Written in Go
  • Stores data in PostgreSQL with pgx

Quickstart

git clone https://github.com/cenkayla/userbalance.git
cd userbalance
go run cmd/main.go

Usage

To get balance

$ curl 'localhost:8080/users/balance/1'

get balance

To add balance

$ curl --request PUT \
	--url "localhost:8080/users/balance/add/1?balance=50" \
	--header "Content-Type: application/x-www-form-urlencoded" \

user balance add

To reduce balance

curl --request PUT \
	--url "localhost:8080/users/balance/reduce/1?balance=50" \
	--header "Content-Type: application/x-www-form-urlencoded" \

balance reduce

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" \

transfer balance

About

Basic user balance service for learning purposes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages