using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace TEAMModelOS.SDK.Module.Cache
{
public interface ICacheService
{
///
/// 验证缓存项是否存在
///
/// 缓存Key
///
bool Exists(string key);
///
/// 验证缓存项是否存在(异步方式)
///
/// 缓存Key
///
Task ExistsAsync(string key);
///
/// 添加缓存
///
/// 缓存Key
/// 缓存Value
///
bool Add(string key, object value);
///
/// 添加缓存(异步方式)
///
/// 缓存Key
/// 缓存Value
///
Task AddAsync(string key, object value);
///
/// 添加缓存
///
/// 缓存Key
/// 缓存Value
/// 滑动过期时长(如果在过期时间内有操作,则以当前时间点延长过期时间)
/// 绝对过期时长
///
bool Add(string key, object value, TimeSpan expiresSliding, TimeSpan expiressAbsoulte);
///
/// 添加缓存(异步方式)
///
/// 缓存Key
/// 缓存Value
/// 滑动过期时长(如果在过期时间内有操作,则以当前时间点延长过期时间)
/// 绝对过期时长
///
Task AddAsync(string key, object value, TimeSpan expiresSliding, TimeSpan expiressAbsoulte);
///
/// 添加缓存
///
/// 缓存Key
/// 缓存Value
/// 缓存时长
/// 是否滑动过期(如果在过期时间内有操作,则以当前时间点延长过期时间)
///
bool Add(string key, object value, TimeSpan expiresIn, bool isSliding = false);
///
/// 添加缓存(异步方式)
///
/// 缓存Key
/// 缓存Value
/// 缓存时长
/// 是否滑动过期(如果在过期时间内有操作,则以当前时间点延长过期时间)
///
Task AddAsync(string key, object value, TimeSpan expiresIn, bool isSliding = false);
///
/// 删除缓存
///
/// 缓存Key
///
bool Remove(string key);
///
/// 删除缓存(异步方式)
///
/// 缓存Key
///
Task RemoveAsync(string key);
///
/// 批量删除缓存
///
/// 缓存Key集合
///
void RemoveAll(IEnumerable keys);
///
/// 批量删除缓存(异步方式)
///
/// 缓存Key集合
///
Task RemoveAllAsync(IEnumerable keys);
///
/// 获取缓存
///
/// 缓存Key
///
T Get(string key) where T : class;
///
/// 获取缓存(异步方式)
///
/// 缓存Key
///
Task GetAsync(string key) where T : class;
///
/// 获取缓存
///
/// 缓存Key
///
object Get(string key);
///
/// 获取缓存(异步方式)
///
/// 缓存Key
///
Task