Skip to content

Latest commit

 

History

History
70 lines (56 loc) · 1.47 KB

README.md

File metadata and controls

70 lines (56 loc) · 1.47 KB

Bredis

Bredis is a Redis-like database with similar functions and an HTTP API.

Installation

cargo install bredis

Usage

bredis run

API

GET

curl http://localhost:4123/keys/mykey

GET BY PREFIX

curl http://localhost:4123/keys?prefix=my

SET

curl -X POST -H "Content-Type: application/json" -d "{\"key\":\"mykey\",\"value\":\"myvalue\"}" http://localhost:4123/keys

SET WITH EXPIRATION

curl -X POST -H "Content-Type: application/json" -d "{\"key\":\"mykey\",\"value\":\"myvalue\",\"ttl\":10}" http://localhost:4123/keys

DELETE

curl -X DELETE http://localhost:4123/keys/mykey

DELETE BY PREFIX

curl -X DELETE -H "Content-Type: application/json" -d "{\"prefix\":\"my\"}" http://localhost:4123/keys

FLUSH

curl -X DELETE http://localhost:4123/keys

GET TTL

curl http://localhost:4123/keys/mykey/ttl

SET TTL

curl -X POST -H "Content-Type: application/json" -d "{\"key\":\"mykey\",\"ttl\":10}" http://localhost:4123/keys/ttl

DELETE TTL

curl -X POST -H "Content-Type: application/json" -d "{\"key\":\"mykey, \"ttl\":-1}" http://localhost:4123/keys/ttl

ROADMAP

  • Add EXPIRE and TTL operations
  • Add pure in-memory rust backend
  • Support stream protocol (websocks, protobuf, resp?)