feat: token缓存逻辑更新(实验性)

This commit is contained in:
CaIon
2024-01-25 20:09:06 +08:00
parent e8188902c2
commit ac3e27859c
4 changed files with 85 additions and 20 deletions

View File

@@ -57,6 +57,11 @@ func RedisGet(key string) (string, error) {
return RDB.Get(ctx, key).Result()
}
func RedisGetEx(key string, expiration time.Duration) (string, error) {
ctx := context.Background()
return RDB.GetSet(ctx, key, expiration).Result()
}
func RedisDel(key string) error {
ctx := context.Background()
return RDB.Del(ctx, key).Err()