RegexBot/Kerobot/Services/EntityCache/EntityCacheService.cs

26 lines
926 B
C#
Raw Normal View History

using System.Threading.Tasks;
namespace Kerobot.Services.EntityCache
{
/// <summary>
/// Provides and maintains a database-backed cache of entities. Portions of information collected by this
/// service may be used by modules, while other portions are useful only for external applications which may
/// require this information, such as an external web interface.
/// </summary>
class EntityCacheService : Service
{
private readonly UserCache _uc;
internal EntityCacheService(Kerobot kb) : base(kb)
{
// Currently we only have UserCache. May add Channel and Server caches later.
_uc = new UserCache(kb);
}
/// <summary>
2019-03-17 00:07:57 +00:00
/// See <see cref="Kerobot.EcQueryUser(ulong, string)"/>.
/// </summary>
internal Task<CachedUser> QueryUserCache(ulong guildId, string search) => _uc.Query(guildId, search);
}
}