https://github.com/sojebsikder/go-kv-base
Simple key value memory store database created using go
https://github.com/sojebsikder/go-kv-base
cli client go golang in-memory-database key-value-database redis server
Last synced: about 1 month ago
JSON representation
Simple key value memory store database created using go
- Host: GitHub
- URL: https://github.com/sojebsikder/go-kv-base
- Owner: SojebSikder
- Created: 2022-12-18T10:20:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-19T06:30:15.000Z (over 3 years ago)
- Last Synced: 2025-02-27T00:35:31.735Z (over 1 year ago)
- Topics: cli, client, go, golang, in-memory-database, key-value-database, redis, server
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-kv-base
Simple key value in-memory database created with golang just for fun.
**Note: data stores in memory, so restarting the server will loose data**
# Usage
## Server
Start server:
```
go run main.go start-server
```
## Client
### Start cli:
```
go run main.go cli
```
Example:
```
set name sojeb
```
```
get name
```
```
delete name
```
```
flush
```
### Api:
POST http://host:port
Set command:
```bash
curl \
'http://host:port' \
-d '{"key":"name","value":"sojeb","command":"set"}'
```
Get command:
```bash
curl \
'http://host:port' \
-d '{"key":"name","command":"get"}'
```
Delete command:
```bash
curl \
'http://host:port' \
-d '{"key":"name","command":"delete"}'
```
Flush command:
```bash
curl \
'http://host:port' \
-d '{"command":"flush"}'
```
## Supported commands:
- Database oparations
- Get - read value by key
- Set - set key value
- Delete - delete value by key
- Flush - delete all key value data