Skip to content

ShockV is a simple key-value store with RESTful API

Notifications You must be signed in to change notification settings

delihiros/shockv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShockV

Shocker mascot

ShockV is a simple key-value store based on badgerDB with RESTful API. It's best suited for experimental project which you need a lightweight data store.

Usage

Install

go install github.com/delihiros/shockv@latest

Server

You have to start server first. The server will handle REST request from any kind of HTTP client.

To start ShockV server:

shockv server start

Client

CRUD method is available through REST API. ShockV provides CLI client to ease interaction with ShockV.

To make database:

$ shockv client new --database hello --diskless false
$ curl "http://localhost:8080/new?database=hello&diskless=false"
{"status":201,"message":""}

if you set --diskless to true the database will be a diskless one and does not preserve data when server is down.

Setting data:

$ shockv client set --database hello --key 1 --value "xyz, abc"
$ curl -X POST -H "Content-Type: application/json" -d '{"key": "1", "value": "xyz, abc"}' http://localhost:8080/hello
{"status":201,"message":""}

You can also set TTL by setting --ttl more than 0.

Getting the value:

shockv client get --database hello --key 1
curl localhost:8080/hello/1
{"status":200,"message":"","body":"xyz, abc"}
shockv client list --database hello
curl localhost:8080/hello
{"status":200,"message":"","body":["1"]}

Deleting the data:

shockv client delete --database hello --key 1
curl -X DELETE http://localhost:8080/hello/1
{"status":200,"message":""}

About

ShockV is a simple key-value store with RESTful API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages