You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
956 B
27 lines
956 B
using System;
|
|
using System.Threading.Tasks;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Wood.Cache
|
|
{
|
|
public interface ICache
|
|
{
|
|
bool SetCache<T>(string key, T value, DateTime? expireTime = null);
|
|
T? GetCache<T>(string key);
|
|
|
|
bool TryGetCache<T>(string key,out T? val);
|
|
|
|
bool RemoveCache(string key);
|
|
|
|
#region Hash
|
|
int SetHashFieldCache<T>(string key, string fieldKey, T fieldValue);
|
|
int SetHashFieldCache<T>(string key, Dictionary<string, T> dict);
|
|
T GetHashFieldCache<T>(string key, string fieldKey);
|
|
Dictionary<string, T> GetHashFieldCache<T>(string key, Dictionary<string, T> dict);
|
|
Dictionary<string, T> GetHashCache<T>(string key);
|
|
List<T> GetHashToListCache<T>(string key);
|
|
bool RemoveHashFieldCache(string key, string fieldKey);
|
|
Dictionary<string, bool> RemoveHashFieldCache(string key, Dictionary<string, bool> dict);
|
|
#endregion
|
|
}
|
|
}
|
|
|