14 lines
311 B
Go
14 lines
311 B
Go
package constants
|
|
|
|
import "fmt"
|
|
|
|
// RedisAuthTokenKey 生成认证令牌的 Redis 键
|
|
func RedisAuthTokenKey(token string) string {
|
|
return fmt.Sprintf("auth:token:%s", token)
|
|
}
|
|
|
|
// RedisRateLimitKey 生成限流的 Redis 键
|
|
func RedisRateLimitKey(ip string) string {
|
|
return fmt.Sprintf("ratelimit:%s", ip)
|
|
}
|