basteh-redis

Crates.iobasteh-redis
lib.rsbasteh-redis
version0.4.0-alpha.5
sourcesrc
created_at2023-02-01 09:10:53.204531
updated_at2023-03-06 18:25:37.979743
descriptionAn implementation of basteh based on redis-rs
homepage
repositoryhttps://github.com/pooyamb/basteh/
max_upload_size
id773442
size33,425
Pouya Mobasher Behrouz (pooyamb)

documentation

https://docs.rs/basteh-redis

README

basteh-redis

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

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");
}
Commit count: 192

cargo fmt