mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-13 02:38:27 -04:00
Killed history
This commit is contained in:
31
NadekoBot.Core/Services/IDataCache.cs
Normal file
31
NadekoBot.Core/Services/IDataCache.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NadekoBot.Core.Services
|
||||
{
|
||||
public interface IDataCache
|
||||
{
|
||||
ConnectionMultiplexer Redis { get; }
|
||||
IImageCache LocalImages { get; }
|
||||
ILocalDataCache LocalData { get; }
|
||||
|
||||
Task<(bool Success, byte[] Data)> TryGetImageDataAsync(Uri key);
|
||||
Task<(bool Success, string Data)> TryGetAnimeDataAsync(string key);
|
||||
Task<(bool Success, string Data)> TryGetNovelDataAsync(string key);
|
||||
Task SetImageDataAsync(Uri key, byte[] data);
|
||||
Task SetAnimeDataAsync(string link, string data);
|
||||
Task SetNovelDataAsync(string link, string data);
|
||||
TimeSpan? AddTimelyClaim(ulong id, int period);
|
||||
TimeSpan? TryAddRatelimit(ulong id, string name, int expireIn);
|
||||
void RemoveAllTimelyClaims();
|
||||
bool TryAddAffinityCooldown(ulong userId, out TimeSpan? time);
|
||||
bool TryAddDivorceCooldown(ulong userId, out TimeSpan? time);
|
||||
bool TryGetEconomy(out string data);
|
||||
void SetEconomy(string data);
|
||||
|
||||
Task<TOut> GetOrAddCachedDataAsync<TParam, TOut>(string key, Func<TParam, Task<TOut>> factory, TParam param, TimeSpan expiry) where TOut : class;
|
||||
DateTime GetLastCurrencyDecay();
|
||||
void SetLastCurrencyDecay();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user