secra-cache 0.1.4

一个基于 Redis 的统一缓存管理库,专为插件化架构设计,提供强隔离、生命周期管理和极简 API
Documentation
[package]
name = "secra-cache"
version = "0.1.4"
edition = "2021"
authors = ["Your Name <your.email@example.com>"]
license = "MIT OR Apache-2.0"
description = "一个基于 Redis 的统一缓存管理库,专为插件化架构设计,提供强隔离、生命周期管理和极简 API"
keywords = ["cache", "redis", "plugin", "async", "tokio"]
categories = ["asynchronous", "caching", "web-programming"]
readme = "README.md"
exclude = [
    "target/",
    "Cargo.lock",
    ".gitignore",
    ".git/",
]

[lib]
name = "secra_cache"
path = "src/lib.rs"

[dependencies]
# 异步 trait 支持
async-trait = "0.1"

# Redis 客户端(可选,按需启用)
rustis = { version = "0.19", optional = true }

# 序列化/反序列化
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

# 并发数据结构
dashmap = "6.1"

# 异步运行时
tokio = { version = "1.0", features = ["sync", "rt-multi-thread", "macros"] }

# 随机数生成(用于 TTL 随机化,防止缓存雪崩)
# 性能优化:使用 fastrand 替代 rand,更快且无需初始化
fastrand = "2.0"

# 结构化日志
tracing = "0.1"

# 错误处理
thiserror = "2.0"

[features]
# 默认不启用具体 Redis 客户端,实现由使用方按需开启
default = []
rustis = ["dep:rustis"]