| Crates.io | rstore |
| lib.rs | rstore |
| version | 0.1.1 |
| created_at | 2025-03-23 16:49:21.861938+00 |
| updated_at | 2025-04-17 16:54:11.355731+00 |
| description | ready |
| homepage | https://github.com/myyrakle/rstore/blob/master/README.md |
| repository | https://github.com/myyrakle/rstore |
| max_upload_size | |
| id | 1602850 |
| size | 60,554 |
# TCP Server
cargo run --bin tcp
# HTTP Server
cargo run --bin 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
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(())
}