crux_cache v0.2.0 Crux.Cache.Guild View Source
Default Crux.Structs.Channel cache.
Unlike other caches this one splits up to different guild processes handling their data individually.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor
Deletes a:
Crux.Structs.Member(if applicable, also theirCrux.Structs.VoiceState) from the guildCrux.Structs.Rolefrom the guildCrux.Structs.Channelfrom the guildCrux.Structs.GuilditselfThis will remove all associated channels and emojis from the appropriate caches
Fetches a guild from the cache by id
Fetches a guild from the cache by id, raises if not found
Inserts a:
Crux.Structs.GuilditselfCrux.Structs.Memberin it- Chunk of
Crux.Structs.Member Crux.Structs.RoleCrux.Structs.Member's rolesCrux.Structs.VoiceState
Looks up the pid/0 of a Crux.Cache.Guild's GenServer by guild id
Updates or inserts a:
Crux.Structs.GuilditselfCrux.Structs.Memberin it- Chunk of
Crux.Structs.Member Crux.Structs.RoleCrux.Structs.Member's rolesCrux.Structs.VoiceState
Link to this section Functions
child_spec(arg) View Source
Returns a specification to start this module under a supervisor.
See Supervisor.
delete(data_or_id)
View Source
delete(
data_or_id ::
Crux.Rest.snowflake()
| Crux.Structs.Guild.t()
| Crux.Structs.Channel.t()
| Crux.Structs.Role.t()
| Crux.Structs.Member.t()
) :: :ok
delete(
data_or_id ::
Crux.Rest.snowflake()
| Crux.Structs.Guild.t()
| Crux.Structs.Channel.t()
| Crux.Structs.Role.t()
| Crux.Structs.Member.t()
) :: :ok
Deletes a:
Crux.Structs.Member(if applicable, also theirCrux.Structs.VoiceState) from the guildCrux.Structs.Rolefrom the guildCrux.Structs.Channelfrom the guildCrux.Structs.GuilditselfThis will remove all associated channels and emojis from the appropriate caches.
fetch(guild_id)
View Source
fetch(guild_id :: Crux.Rest.snowflake()) ::
{:ok, Crux.Structs.Guild.t()} | :error
fetch(guild_id :: Crux.Rest.snowflake()) ::
{:ok, Crux.Structs.Guild.t()} | :error
Fetches a guild from the cache by id.
fetch!(guild_id)
View Source
fetch!(guild_id :: Crux.Rest.snowflake()) ::
Crux.Structs.Guild.t() | no_return()
fetch!(guild_id :: Crux.Rest.snowflake()) :: Crux.Structs.Guild.t() | no_return()
Fetches a guild from the cache by id, raises if not found.
insert(data) View Source
Inserts a:
Crux.Structs.GuilditselfCrux.Structs.Memberin it- Chunk of
Crux.Structs.Member Crux.Structs.RoleCrux.Structs.Member's rolesCrux.Structs.VoiceState
lookup(guild_id)
View Source
lookup(guild_id :: Crux.Rest.snowflake()) :: {:ok, pid()} | :error
lookup(guild_id :: Crux.Rest.snowflake()) :: {:ok, pid()} | :error
Looks up the pid/0 of a Crux.Cache.Guild's GenServer by guild id.
update(data) View Source
Updates or inserts a:
Crux.Structs.GuilditselfCrux.Structs.Memberin it- Chunk of
Crux.Structs.Member Crux.Structs.RoleCrux.Structs.Member's rolesCrux.Structs.VoiceState