Crates.io | qm-redis |
lib.rs | qm-redis |
version | 0.0.60 |
created_at | 2024-03-14 11:23:05.69972+00 |
updated_at | 2025-08-11 12:11:06.550655+00 |
description | Redis helper functions |
homepage | |
repository | https://github.com/hd-gmbh-dev/quick-microservice-rs |
max_upload_size | |
id | 1173259 |
size | 61,448 |
qm-redis
utilities to work with the Redis database
With this crate it is easy to get a Redis configuration with the most common settings. It also provides common helpers to handle locks and use workers with queues.
let redis_config = qm::redis::RedisConfig::new()?;
The Config
is populated with environment variables. By default, all variables with the prefix
REDIS_
are considered.
The prefix can be changed by using a builder pattern.
let example_config = qm::redis::RedisConfig::builder().with_prefix("REDIS_").build()?;
These variables are available and are set with the following defaults.
variable | struct field | default |
---|---|---|
MONGODB_HOST | host | "127.0.0.1" |
MONGODB_PORT | port | 6379 |
address | redis://{host}:{port}/ |