sa_token_plugin_tide/lib.rs
1// Author: 金书记
2//
3// 中文 | English
4// Tide 框架集成 | Tide Framework Integration
5//
6//! # sa-token-plugin-tide
7//!
8//! 为 Tide 框架提供 sa-token 认证和授权支持
9//! Provides sa-token authentication and authorization support for Tide framework
10//!
11//! ## 特性 | Features
12//!
13//! - ✨ 一行导入所有功能 | One-line import for all functionalities
14//! - 🔧 支持多种存储后端 | Support for multiple storage backends
15//! - 🚀 简化的中间件集成 | Simplified middleware integration
16//! - 📦 包含核心、宏、存储 | Includes core, macros, and storage
17//!
18//! ## 快速开始 | Quick Start
19//!
20//! ```toml
21//! [dependencies]
22//! sa-token-plugin-tide = "0.1.4"
23//! ```
24//!
25//! ```rust,ignore
26//! use sa_token_plugin_tide::*;
27//!
28//! #[async_std::main]
29//! async fn main() -> tide::Result<()> {
30//! let storage = Arc::new(MemoryStorage::new());
31//!
32//! SaTokenConfig::builder()
33//! .token_name("Authorization")
34//! .timeout(7200)
35//! .storage(storage)
36//! .build();
37//!
38//! let mut app = tide::new();
39//! app.at("/login").post(login_handler);
40//! app.at("/user").get(user_info_handler);
41//!
42//! app.listen("127.0.0.1:8080").await?;
43//! Ok(())
44//! }
45//! ```
46
47pub mod adapter;
48pub mod middleware;
49
50// 重新导出核心功能 | Re-export core functionalities
51pub use sa_token_core::*;
52pub use sa_token_adapter::*;
53pub use sa_token_macro::*;
54
55// 重新导出存储实现(通过 feature 控制)
56// Re-export storage implementations (controlled by features)
57#[cfg(feature = "memory")]
58pub use sa_token_storage_memory::*;
59
60#[cfg(feature = "redis")]
61pub use sa_token_storage_redis::*;
62
63#[cfg(feature = "database")]
64pub use sa_token_storage_database::*;
65
66// 重新导出本模块的适配器 | Re-export adapters from this module
67pub use adapter::*;
68pub use middleware::*;
69