ub

command module
v0.0.0-...-bb9156f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

ub - user balance

REST API system for registering users and storing their balances

Running the application
go run .
Running tests (app must be running)
go test .

HTTP Methods

"GET" / — Checking the server connection

    example: 
        "GET" :8080/
"GET" /ping — Checking the server connection

    example: 
        "GET" :8080/ping
"GET" /user — Get a user data

    options:
        id — User ID

    example: 
        "GET" :8080/user?id=sadf54-fdsa48-dsaf459-dsaf45
"POST" /user — Create a new user. Need JSON body

    example: 
        "POST" :8080/create
{
    "email" : "ipchchv@gmail.com",
	"name" : "Jack",
	"password" : "3223414r"
}
"PATCH" /balance — Update user balance. Need JSON body
{
    "id" : "sadf54-fdsa48-dsaf459-dsaf45",
	"operation" : "deposit",
	"amount" : 175.5
}
"DELETE" /user — Delete one User

    options:
        id — User ID

    example: 
        "DELETE" :8080/user?id=sadf54-fdsa48-dsaf459-dsaf45

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL