MyGit
🚩收到GitHub仓库的更新通知

actix/actix-redis

Fork: 50 Star: 110 (更新于 2024-05-06 19:08:37)

license: Apache-2.0

Language: Rust .

Redis actor and middleware for Actix

最后发布版本: v0.8.0 ( 2019-12-21 00:13:22)

GitHub网址

✨免费申请网站SSL证书,支持多域名和泛域名,点击查看

Actix redis Build Status codecov crates.io

Redis integration for actix framework.

NOTICE: This repository has been archived. Please visit https://github.com/actix/actix-extras instead.

Documentation

Redis session backend

Use redis as session storage.

You need to pass an address of the redis server and random value to the constructor of RedisSessionBackend. This is private key for cookie session, When this value is changed, all session data is lost.

Note that whatever you write into your session is visible by the user (but not modifiable).

Constructor panics if key length is less than 32 bytes.

use actix_web::{App, HttpServer, web, middleware};
use actix_web::middleware::session::SessionStorage;
use actix_redis::RedisSessionBackend;

#[actix_rt::main]
async fn main() -> std::io::Result {
    HttpServer::new(|| App::new()
        // enable logger
        .middleware(middleware::Logger::default())
        // cookie session middleware
        .middleware(SessionStorage::new(
            RedisSessionBackend::new("127.0.0.1:6379", &[0; 32])
        ))
        // register simple route, handle all methods
        .service(web::resource("/").to(index))
    )
    .bind("0.0.0.0:8080")?
    .start()
    .await
}

License

This project is licensed under either of

at your option.

Code of Conduct

Contribution to the actix-redis crate is organized under the terms of the Contributor Covenant, the maintainer of actix-redis, @fafhrd91, promises to intervene to uphold that code of conduct.

最近版本更新:(数据更新于 2024-04-23 22:53:39)

2019-12-21 00:13:22 v0.8.0

2019-09-25 21:29:52 v0.7.0

2019-07-19 16:11:21 v0.6.1

2019-07-11 17:05:16 v0.6.0

2018-08-03 02:49:17 v0.5.1

2018-07-21 21:55:56 v0.5.0

2018-05-09 01:50:35 v0.4.0

2018-04-11 03:23:38 v0.3.0

2018-03-01 02:16:41 v0.2.0

2018-01-24 02:08:14 v0.1.0

主题(topics):

acitx, redis

actix/actix-redis同语言 Rust最近更新仓库

2024-05-11 16:22:06 rustdesk/rustdesk

2024-05-11 09:11:39 lapce/lapce

2024-05-10 16:04:53 qdrant/qdrant

2024-05-10 12:13:19 FuelLabs/fuels-rs

2024-05-10 02:55:38 tauri-apps/tauri

2024-05-10 02:05:41 zed-industries/zed