View Source Nostrum.Cache.GuildCache.Mnesia (Nostrum v0.10.0)
An Mnesia-based cache for guilds.
Please note that this module is only compiled if Mnesia is available on your system. See the Mnesia section of the State documentation for more information.
To retrieve the table name used by this cache, use table/0
.
Summary
Functions
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.
Clear any objects in the cache.
Create a guild from upstream data.
Remove the given guild from the cache.
Update the emoji list for the given guild in the cache.
Get a guild from the cache.
Set up the cache's Mnesia table.
Decrement the guild member count by one.
Increment the guild member count by one.
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.
Start the supervisor.
Update the sticker list for the given guild in the cache.
Retrieve the Mnesia table name used for the cache.
Drop the table used for caching.
Update the given guild in the cache.
Update guild voice states with the given voice state in the cache.
Wrap queries in a transaction.
Functions
@spec channel_create(Nostrum.Struct.Guild.id(), map()) :: Nostrum.Struct.Channel.t()
Create the given channel for the given guild in the cache.
@spec 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.
@spec channel_update(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Channel.t() | nil, 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
.
@spec clear() :: :ok
Clear any objects in the cache.
@spec create(map()) :: Nostrum.Struct.Guild.t()
Create a guild from upstream data.
@spec delete(Nostrum.Struct.Guild.id()) :: Nostrum.Struct.Guild.t() | nil
Remove the given guild from the cache.
@spec 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.
@spec get(Nostrum.Struct.Guild.id()) :: {:ok, Nostrum.Struct.Guild.t()} | {:error, :not_found}
Get a guild from the cache.
Set up the cache's Mnesia table.
@spec member_count_down(Nostrum.Struct.Guild.id()) :: true
Decrement the guild member count by one.
@spec member_count_up(Nostrum.Struct.Guild.id()) :: true
Increment the guild member count by one.
@spec 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.
@spec 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.
@spec role_update(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Role.t() | nil, Nostrum.Struct.Guild.Role.t()}
Update the given role in the given guild in the cache.
Start the supervisor.
@spec stickers_update(Nostrum.Struct.Guild.id(), [map()]) :: {[Nostrum.Struct.Sticker.t()], [Nostrum.Struct.Sticker.t()]}
Update the sticker list for the given guild in the cache.
@spec table() :: atom()
Retrieve the Mnesia table name used for the cache.
@spec teardown() :: {:atomic, :ok} | {:aborted, term()}
Drop the table used for caching.
@spec update(map()) :: {Nostrum.Struct.Guild.t() | nil, Nostrum.Struct.Guild.t()}
Update the given guild in the cache.
@spec 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.
Wrap queries in a transaction.