summaryrefslogtreecommitdiff
path: root/common/rust/src/redis.rs
diff options
context:
space:
mode:
authorn1c00o <34602094+n1c00o@users.noreply.github.com>2021-10-16 22:26:09 +0200
committerGitHub <noreply@github.com>2021-10-16 22:26:09 +0200
commite58e816ceb8caa3c77dd98a952761b7e7f05b6cb (patch)
treeca5c9409986ff538e7a674473c1d642627d1055c /common/rust/src/redis.rs
parent03908129599260587fe7b9fd8254d28ad50b8714 (diff)
parentb94b0552f81e667bec31352901bbc8c76f1b4216 (diff)
Merge branch 'main' into nats-structs-discord-gateway
Diffstat (limited to 'common/rust/src/redis.rs')
-rw-r--r--common/rust/src/redis.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/rust/src/redis.rs b/common/rust/src/redis.rs
new file mode 100644
index 0000000..a196f8d
--- /dev/null
+++ b/common/rust/src/redis.rs
@@ -0,0 +1,15 @@
+use redis::Client;
+use serde::Deserialize;
+
+
+#[derive(Clone, Debug, Deserialize)]
+pub struct RedisConfiguration {
+ pub url: String,
+}
+
+// Allows the configuration to directly create a nats connection
+impl Into<Client> for RedisConfiguration {
+ fn into(self) -> Client {
+ redis::Client::open(self.url).unwrap()
+ }
+}