From fd9ad6227899f91a39d162d891c5ea92dc38800f Mon Sep 17 00:00:00 2001 From: alban Date: Mon, 17 Jul 2023 22:44:06 +0200 Subject: [PATCH] feat: add redis populate --- README.md | 0 examples/populate_redis.rs | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 README.md create mode 100644 examples/populate_redis.rs diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/examples/populate_redis.rs b/examples/populate_redis.rs new file mode 100644 index 0000000..cd95e77 --- /dev/null +++ b/examples/populate_redis.rs @@ -0,0 +1,24 @@ +/// +/// $ cargo run --example populate_redis +/// + +use redis::{ + //RedisResult, + Client, + Commands, + Connection, +}; + +fn do_something() -> redis::RedisResult<()> { + let client = Client::open("redis://127.0.0.1/")?; + let mut con: Connection = client.get_connection()?; + + let _ = con.set("/clientkey", "/pl/0/")?; + let _ = con.set("/EDH/0", "[[1.0, 0.0, 0.0],\n [ 0.0, 1.0, 0.0],\n [ 0.0, 0.0, 1.0]]")?; + let _ = con.set("/kpps/0", "5000")?; + let _ = con.set("/intensity/0", "255")?; + Ok(()) +} +fn main() { + _ = do_something(); +}