2017-09-13 01:12:40 +00:00
|
|
|
|
using StackExchange.Redis;
|
2017-10-26 09:31:44 +00:00
|
|
|
|
using System;
|
2017-09-12 20:27:51 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2017-10-13 04:14:54 +00:00
|
|
|
|
namespace NadekoBot.Core.Services
|
2017-09-12 20:27:51 +00:00
|
|
|
|
{
|
|
|
|
|
public interface IDataCache
|
|
|
|
|
{
|
2017-09-13 01:12:40 +00:00
|
|
|
|
ConnectionMultiplexer Redis { get; }
|
2017-09-12 20:27:51 +00:00
|
|
|
|
Task<(bool Success, byte[] Data)> TryGetImageDataAsync(string key);
|
2017-09-15 00:42:51 +00:00
|
|
|
|
Task<(bool Success, string Data)> TryGetAnimeDataAsync(string key);
|
2017-09-12 20:27:51 +00:00
|
|
|
|
Task SetImageDataAsync(string key, byte[] data);
|
2017-09-15 00:42:51 +00:00
|
|
|
|
Task SetAnimeDataAsync(string link, string data);
|
2017-10-26 09:31:44 +00:00
|
|
|
|
TimeSpan? AddTimelyClaim(ulong id, int period);
|
2017-10-26 11:03:53 +00:00
|
|
|
|
void RemoveAllTimelyClaims();
|
2017-09-12 20:27:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|