KiViDB

­čąŁKiviDB is simple key-value database written in Golang.

Installation

  1. Build project:
go build .
  1. Create .env file like this:

DIR_NAME=YOUR_DB_NAME
ADDRESS=8080
LOG_FILE=kividb.log
HOST=localhost
  1. Run ./kiviDB
  2. Setup and work with database by http API.

Routes

/core /filter /cluster

Request

/core (for single-document operations):

Get document by id in cluster

GET:

{
"Cluster": "cluster_name",
 "Id": "object_id"
}

Create new value in cluster with autogenerated-key:

POST:

{
"Cluster": "cluster_name",
 "Value": "object_value"
}

Create new value in cluster with known-key:

{
"Cluster": "cluster_name",
 "Id": "optional_id",
 "Value": "object_value"
}

Delete value by id (in cluster, of course):

DELETE:

{
 "Cluster": "cluster_name",
 "Id": "object_id"
}

/cluster (for create and delete cluster):

Create cluster:

POST:

{
 "Cluster": "cluster_name"
}

Get all documents in cluster:

GET:

{
 "Cluster": "cluster_name",
}

Delete cluster (warning! it also delete all documents in cluster!):

DELETE:

{
 "Cluster": "cluster_name"
}

/filter (for get many documents in cluster):

Get all documents, which value contain to regex:

GET:

{
 "Cluster": "cluster_name",
 "Regex": "regular_expression"
}

Delete all documents, which doesn’t contain to regex:

DELETE:

{
 "Cluster": "cluster_name",
 "Regex": "regular_expression"
}

GitHub

View Github