Crux v2020-03-17 17:55:51Z 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
Fetches a guild from the cache by id.
Fetches a guild from the cache by id, raises if not found.
Inserts a
Looks up the pid/0
of a Crux.Cache.Guild
's GenServer
by guild id.
Updates or inserts a
Link to this section Functions
child_spec(init_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.Role
from the guildCrux.Structs.Channel
from the guildCrux.Structs.Guild
itselfThis 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.Guild
itselfCrux.Structs.Member
in it- Chunk of
Crux.Structs.Member
Crux.Structs.Role
Crux.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.Guild
itselfCrux.Structs.Member
in it- Chunk of
Crux.Structs.Member
Crux.Structs.Role
Crux.Structs.Member
's rolesCrux.Structs.VoiceState