An open API service indexing awesome lists of open source software.

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

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