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

This commit is contained in:
CaIon
2024-01-25 20:09:06 +08:00
parent d238aaeaa1
commit a2873b6d67
4 changed files with 85 additions and 20 deletions
+5
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()