Simple key value in-memory database created with golang just for fun.
Note: data stores in memory, so restarting the server will loose data
Start server:
go run main.go start-server <port>
go run main.go cli <server_url>
Example:
set name sojeb
get name
delete name
flush
POST http://host:port
Set command:
curl \
'http://host:port' \
-d '{"key":"name","value":"sojeb","command":"set"}'
Get command:
curl \
'http://host:port' \
-d '{"key":"name","command":"get"}'
Delete command:
curl \
'http://host:port' \
-d '{"key":"name","command":"delete"}'
Flush command:
curl \
'http://host:port' \
-d '{"command":"flush"}'
-
Database oparations
- Get - read value by key
- Set - set key value
- Delete - delete value by key
- Flush - delete all key value data