做完了一部分,备份一下,防止以外删除
This commit is contained in:
13
pkg/constants/redis.go
Normal file
13
pkg/constants/redis.go
Normal file
@@ -0,0 +1,13 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user