Files
common/redis/keys.go

20 lines
924 B
Go
Raw Normal View History

package redis
2025-12-29 14:44:32 +08:00
// Redis 数据缓存 Key 常量
const (
CleanList = "list:tenantId-%v:collection-%s:*" // 清理列表Key
CleanCount = "count:tenantId-%v:collection-%s:*" // 清理计数Key
List = "list:tenantId-%v:collection-%s:filter:%s:options:%s" // 列表查询Key
Count = "count:tenantId-%v:collection-%s:filter:%s" // 计数查询Key
One = "one:tenantId-%v:collection-%s:filter:%s" // 单条查询Key
)
// 限流 Redis Key 常量
const (
2026-01-05 16:28:29 +08:00
RateLimitKeyPrefix = "ragflow:ratelimit:" // 限流Key前缀
RateLimitKeyIP = "ip:%s" // IP限流: ip:192.168.1.1
RateLimitKeyUser = "user:%s" // 用户限流: user:123 或 user:anon:192.168.1.1
RateLimitKeyService = "service:%s" // 服务限流: service:customerService
RateLimitKeyGlobal = "global:requests" // 全局限流: global:requests
2025-12-29 14:44:32 +08:00
)