From 7c9b809078b5cd53e3d54c0004c683da2ec679af Mon Sep 17 00:00:00 2001 From: Adelyn Breedlove Date: Mon, 11 Feb 2019 17:23:59 +0000 Subject: Add a cache --- lib/cache.mli | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/cache.mli (limited to 'lib/cache.mli') diff --git a/lib/cache.mli b/lib/cache.mli new file mode 100644 index 0000000..111e5bc --- /dev/null +++ b/lib/cache.mli @@ -0,0 +1,27 @@ +open Async +open Core + +module ChannelMap : module type of Map.Make(Channel_id_t) +module GuildMap : module type of Map.Make(Guild_id_t) +module UserMap : module type of Map.Make(User_id_t) + +type t = { + text_channels: Channel_t.guild_text ChannelMap.t; + voice_channels: Channel_t.guild_voice ChannelMap.t; + categories: Channel_t.category ChannelMap.t; + groups: Channel_t.group ChannelMap.t; + private_channels: Channel_t.dm ChannelMap.t; + guilds: Guild_t.t GuildMap.t; + presences: Presence.t UserMap.t; + (* messages: Channel_id_t.t GuildMap.t; *) + unavailable_guilds: Guild_t.unavailable GuildMap.t; + user: User_t.t option; + users: User_t.t UserMap.t; +} + +val cache : t Mvar.Read_write.t + +val create : + (* ?max_messages:int -> *) + unit -> + t \ No newline at end of file -- cgit v1.2.3