View Source Nostrum.Cache.GuildCache.ETS (Nostrum v0.6.0)
An ETS-based cache for guilds.
The supervisor defined by this module will set up the ETS table associated with it.
The default table name under which guilds are cached is nostrum_guilds
.
In addition to the cache behaviour implementations provided by this module,
you can also call regular ETS table methods on it, such as :ets.info
.
Note that users should not call the functions not related to this specific
implementation of the cache directly. Instead, call the functions of
Nostrum.Cache.GuildCache
directly, which will dispatch to the configured
cache.
Link to this section Summary
Functions
Retrieve all guilds from the cache.
Create the given channel for the given guild in the cache.
Delete the channel from the given guild in the cache.
Update the channel on the given guild in the cache.
Returns a specification to start this module under a supervisor.
Create the given guild in the cache.
Delete the given guild from the cache.
Update the emoji list for the given guild in the cache.
Retrieve a guild from the cache by ID.
Get a guild from the cache using the given selectors.
Set up the cache's ETS table.
Add the given member to the given guild in the cache.
Create a chunk of members for the given guild in the cache.
Remove the given member from the given guild in the cache.
Update the given member for the given guild in the cache.
Create the given role in the given guild in the cache.
Delete the given role from the given guild in the cache.
Update the given role in the given guild in the cache.
Select values from the guild with the matching ID.
Retrieve all guilds matching the given selector from the cache.
Select values using a selector
for a guild that matches the given clauses
.
Start the supervisor.
Retrieve the ETS table name used for the cache.
Update the given guild in the cache.
Update guild voice states with the given voice state in the cache.
Link to this section Functions
Specs
all() :: Enum.t()
Retrieve all guilds from the cache.
Specs
channel_create(Nostrum.Struct.Guild.id(), map()) :: Nostrum.Struct.Channel.t()
Create the given channel for the given guild in the cache.
Specs
channel_delete(Nostrum.Struct.Guild.id(), Nostrum.Struct.Channel.id()) :: Nostrum.Struct.Channel.t() | :noop
Delete the channel from the given guild in the cache.
Specs
channel_update(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Channel.t(), Nostrum.Struct.Channel.t()}
Update the channel on the given guild in the cache.
Returns a specification to start this module under a supervisor.
See Supervisor
.
Specs
create(Nostrum.Struct.Guild.t()) :: true
Create the given guild in the cache.
Specs
delete(Nostrum.Struct.Guild.id()) :: Nostrum.Struct.Guild.t() | nil
Delete the given guild from the cache.
Specs
emoji_update(Nostrum.Struct.Guild.id(), [map()]) :: {[Nostrum.Struct.Emoji.t()], [Nostrum.Struct.Emoji.t()]}
Update the emoji list for the given guild in the cache.
Specs
get(Nostrum.Struct.Guild.id()) :: {:ok, Nostrum.Struct.Guild.t()} | {:error, Nostrum.Cache.GuildCache.reason()}
Retrieve a guild from the cache by ID.
Specs
get_by(Nostrum.Cache.GuildCache.clauses()) :: {:ok, Nostrum.Struct.Guild.t()} | {:error, Nostrum.Cache.GuildCache.reason()}
Get a guild from the cache using the given selectors.
Set up the cache's ETS table.
Specs
member_add(Nostrum.Struct.Guild.id(), map()) :: Nostrum.Struct.Guild.Member.t()
Add the given member to the given guild in the cache.
Create a chunk of members for the given guild in the cache.
Specs
member_remove(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Member.t()} | :noop
Remove the given member from the given guild in the cache.
Specs
member_update(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Member.t() | nil, Nostrum.Struct.Guild.Member.t()}
Update the given member for the given guild in the cache.
Specs
role_create(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Role.t()}
Create the given role in the given guild in the cache.
Specs
role_delete(Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Role.id()) :: {Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Role.t()} | :noop
Delete the given role from the given guild in the cache.
Specs
role_update(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Role.t(), Nostrum.Struct.Guild.Role.t()}
Update the given role in the given guild in the cache.
Specs
select(Nostrum.Struct.Guild.id(), Nostrum.Cache.GuildCache.selector()) :: {:ok, any()} | {:error, Nostrum.Cache.GuildCache.reason()}
Select values from the guild with the matching ID.
Specs
select_all(Nostrum.Cache.GuildCache.selector()) :: Enum.t()
Retrieve all guilds matching the given selector from the cache.
Specs
select_by( Nostrum.Cache.GuildCache.clauses(), Nostrum.Cache.GuildCache.selector() ) :: {:ok, any()} | {:error, Nostrum.Cache.GuildCache.reason()}
Select values using a selector
for a guild that matches the given clauses
.
Start the supervisor.
Specs
tabname() :: atom()
Retrieve the ETS table name used for the cache.
Specs
update(map()) :: {Nostrum.Struct.Guild.t(), Nostrum.Struct.Guild.t()}
Update the given guild in the cache.
Specs
voice_state_update(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Guild.id(), [map()]}
Update guild voice states with the given voice state in the cache.