rstore

Crates.iorstore
lib.rsrstore
version0.1.1
created_at2025-03-23 16:49:21.861938+00
updated_at2025-04-17 16:54:11.355731+00
descriptionready
homepagehttps://github.com/myyrakle/rstore/blob/master/README.md
repositoryhttps://github.com/myyrakle/rstore
max_upload_size
id1602850
size60,554
myyrakle (myyrakle)

documentation

https://github.com/myyrakle/rstore/blob/master/README.md

README

rstore

GitHub license

  • simple Key-Value in-memory store
  • HTTP or TCP server

Just run (Local)

# TCP Server
cargo run --bin tcp

# HTTP Server
cargo run --bin http

Start with Docker (HTTP)

run server

sudo docker run -p 13535:13535 myyrakle/rstore:http-0.1.0

ping

curl http://localhost:13535

set value

curl -X POST http://localhost:13535/value \
  -H "Content-Type: application/json" \
  -d '{"key": "example", "value": "42"}'

get value

curl -X GET http://localhost:13535/value?key=example

delete

curl -X DELETE http://localhost:13535/value?key=example

clear

curl -X DELETE http://localhost:13535/clear

Start with Docker (TCP)

run server

sudo docker run -p 13535:13535 myyrakle/rstore:tcp-0.1.0

client code

pub mod protocol;

extern crate serde;
use rstore::{
    client::{ClientResult, ConnectionConfig, RStoreClient},
    protocol::{GetRequest, SetRequest},
};

#[tokio::main]
async fn main() -> ClientResult<()> {
    let client = RStoreClient::new(ConnectionConfig {
        host: "0.0.0.0".to_string(),
        port: 13535,
        ..Default::default()
    });

    client.connect().await?;

    client.ping().await?;
    println!("PING PONG");

    client
        .set(SetRequest {
            key: "key".to_string(),
            value: "value".to_string(),
        })
        .await?;

    let response = client
        .get(GetRequest {
            key: "key".to_string(),
        })
        .await?;

    println!("Response: {:?}", response);

    Ok(())
}
Commit count: 74

cargo fmt