cryo_sessions/
lib.rs

1//! # cryo-sessions
2//! This crate is intended for people who want to store user sessions locally in Redis.
3//! 
4//! # Example
5//! ```rust
6//! let uuid = Uuid::new();
7//! let redis = Redis::from_env(); // this method takes the redis url from the REDIS_URL environment variable
8//! let session = Session::new();
9//! redis.new_session(session.to_owned(), SessionInfo::new(uuid.to_owned(), "Mozilla(5.0)".into()), Duration::from_secs(2400)).await.is_ok();
10//! redis.new_session(session.to_owned(), SessionInfo::new(uuid.to_owned(), "Apple Safari".into()), Duration::from_secs(3400)).await.is_ok();
11//! let info = redis.get_information_by_session(session).await.unwrap();
12//! println!("{:?}", info);
13//! ```
14
15mod redis;
16mod session;
17mod uuid;
18
19pub use crate::{redis::Redis, session::{Session, SessionInfo}, uuid::Uuid};