| Crates.io | basteh-redis |
| lib.rs | basteh-redis |
| version | 0.4.0-alpha.5 |
| created_at | 2023-02-01 09:10:53.204531+00 |
| updated_at | 2023-03-06 18:25:37.979743+00 |
| description | An implementation of basteh based on redis-rs |
| homepage | |
| repository | https://github.com/pooyamb/basteh/ |
| max_upload_size | |
| id | 773442 |
| size | 33,425 |
This crate provides an implementation for basteh based on redis.
Please refer to basteh crate documentations for full details about usage and use cases.
RedisBackend is a full store with expiration implementation.
use basteh_redis::{RedisBackend, ConnectionInfo, RedisConnectionInfo, ConnectionAddr};
async fn my_main() {
// Connecting to the redis instance on localhost without username/password(for dev env)
let store = RedisBackend::connect_default().await.expect("Redis connection failed");
// OR connect with the provided redis::ConnectionInfo
let connection_info = ConnectionInfo {
addr: ConnectionAddr::Tcp("127.0.0.1".to_string(), 1234).into(),
redis: RedisConnectionInfo{
db: 0,
username: Some("god".to_string()),
password: Some("bless".to_string()),
}
};
let store = RedisBackend::connect(connection_info).await.expect("Redis connection failed");
}