using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MyCode.Project.Infrastructure.Cache { public interface IMyCodeCacheService { /// /// 根据key得到缓存值 /// /// 缓存key /// object Get(string key); /// /// 根据缓存Key返回一个具体的对象 /// /// /// /// T Get(string key); /// /// 设置缓存 /// /// 缓存Key /// 缓存对象 /// 过期时间 void Set(string key, object cache_object, TimeSpan? expiration=null); /// /// 根据key删除一个缓存 /// /// void Delete(string key); /// /// 判断是否存在缓存 /// /// /// bool Exists(string key); /// /// 放入队列 /// /// /// void Push(string key, object data); /// /// Popup(获取第一条数据,并删除) /// /// /// object Popup(string key); /// /// 自增1,返回自增后的值 /// /// /// long Incr(string key,long value = 1); /// /// 初始化原子性的功能 /// /// /// void SetIncr(string key, long data); /// /// 得到Incr值 /// /// /// object GetIncr(string key); /// /// 得到新的id /// /// /// long GetNewId(); /// /// 返回列表长度 /// /// /// long ListLen(string key); } }