NadekoBot/NadekoBot.Core/Services/IDataCache.cs

25 lines
923 B
C#
Raw Normal View History

using StackExchange.Redis;
using System;
using System.Threading.Tasks;
namespace NadekoBot.Core.Services
{
public interface IDataCache
{
ConnectionMultiplexer Redis { get; }
2017-11-05 12:28:08 +00:00
IImageCache LocalImages { get; }
ILocalDataCache LocalData { get; }
2017-11-05 12:28:08 +00:00
Task<(bool Success, byte[] Data)> TryGetImageDataAsync(string key);
Task<(bool Success, string Data)> TryGetAnimeDataAsync(string key);
2017-11-02 17:22:17 +00:00
Task<(bool Success, string Data)> TryGetNovelDataAsync(string key);
Task SetImageDataAsync(string key, byte[] data);
Task SetAnimeDataAsync(string link, string data);
2017-11-02 17:22:17 +00:00
Task SetNovelDataAsync(string link, string data);
TimeSpan? AddTimelyClaim(ulong id, int period);
void RemoveAllTimelyClaims();
bool TryAddAffinityCooldown(ulong userId, out TimeSpan? time);
bool TryAddDivorceCooldown(ulong userId, out TimeSpan? time);
}
}