/micro_kv

minimal key value database written in rust

Primary LanguageRustMIT LicenseMIT

micro-kv

A minimal key-value database written in Rust.

Quickstart

Docker

docker run mioherman/micro-kv:latest -p 3310:3310 --name micro-kv -d

Compile and run binary

cargo build --release
./target/release/micro-kv

Usage

Set a key

curl --request POST \
  --url 'http://localhost:3310/123?ttl=60' \
  --header 'Content-Type: application/json' \
  --data '{
	"_id": "123",
	"name": "John Doe"
}'

Get a key

curl --request GET \
  --url 'http://localhost:3310/123'

Get all keys

curl --request GET \
  --url 'http://localhost:3310'

Get TTL of a key

curl --request GET \
  --url 'http://localhost:3310/ttl/123'

Delete a key

curl --request DELETE \
  --url 'http://localhost:3310/123'

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Conventional Commits

Please use Conventional Commits for commit messages.

License

MIT