forked from anjoy8/Blog.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIRedisBasketRepository.cs
More file actions
47 lines (38 loc) · 1.7 KB
/
IRedisBasketRepository.cs
File metadata and controls
47 lines (38 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Blog.Core.Extensions
{
/// <summary>
/// Redis缓存接口
/// </summary>
public interface IRedisBasketRepository
{
//获取 Reids 缓存值
Task<string> GetValue(string key);
//获取值,并序列化
Task<TEntity> Get<TEntity>(string key);
//保存
Task Set(string key, object value, TimeSpan cacheTime);
//判断是否存在
Task<bool> Exist(string key);
//移除某一个缓存值
Task Remove(string key);
//全部清除
Task Clear();
Task<RedisValue[]> ListRangeAsync(string redisKey);
Task<long> ListLeftPushAsync(string redisKey, string redisValue, int db = -1);
Task<long> ListRightPushAsync(string redisKey, string redisValue, int db = -1);
Task<long> ListRightPushAsync(string redisKey, IEnumerable<string> redisValue, int db = -1);
Task<T> ListLeftPopAsync<T>(string redisKey, int db = -1) where T : class;
Task<T> ListRightPopAsync<T>(string redisKey, int db = -1) where T : class;
Task<string> ListLeftPopAsync(string redisKey, int db = -1);
Task<string> ListRightPopAsync(string redisKey, int db = -1);
Task<long> ListLengthAsync(string redisKey, int db = -1);
Task<IEnumerable<string>> ListRangeAsync(string redisKey, int db = -1);
Task<IEnumerable<string>> ListRangeAsync(string redisKey, int start, int stop, int db = -1);
Task<long> ListDelRangeAsync(string redisKey, string redisValue, long type = 0, int db = -1);
Task ListClearAsync(string redisKey, int db = -1);
}
}