using StackExchange.Redis; using System; using System.Collections.Generic; using System.ComponentModel; using System.Threading.Tasks; namespace EntrustSettle.Extensions { /// /// Redis缓存接口 /// [Description("普通缓存考虑直接使用ICaching,如果要使用Redis队列等还是使用此类")] public interface IRedisBasketRepository { //获取 Reids 缓存值 Task GetValue(string key); //获取值,并序列化 Task Get(string key); //保存 Task Set(string key, object value, TimeSpan cacheTime); //判断是否存在 Task Exist(string key); //移除某一个缓存值 Task Remove(string key); //全部清除 Task Clear(); Task ListRangeAsync(string redisKey); Task ListLeftPushAsync(string redisKey, string redisValue, int db = -1); Task ListRightPushAsync(string redisKey, string redisValue, int db = -1); Task ListRightPushAsync(string redisKey, IEnumerable redisValue, int db = -1); Task ListLeftPopAsync(string redisKey, int db = -1) where T : class; Task ListRightPopAsync(string redisKey, int db = -1) where T : class; Task ListLeftPopAsync(string redisKey, int db = -1); Task ListRightPopAsync(string redisKey, int db = -1); Task ListLengthAsync(string redisKey, int db = -1); Task> ListRangeAsync(string redisKey, int db = -1); Task> ListRangeAsync(string redisKey, int start, int stop, int db = -1); Task ListDelRangeAsync(string redisKey, string redisValue, long type = 0, int db = -1); Task ListClearAsync(string redisKey, int db = -1); } }