View Source Nostrum.Store.GuildShardMapping.Mnesia (Nostrum v0.10.0)
Maintains a mapping of guild IDs to their shard numbers using Mnesia.
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
Returns a specification to start this module under a supervisor.
Create a new mapping for the given guild ID to the given shard ID.
Delete any stored mapping for the given guild ID.
Get the shard number for the given guild ID.
Set up the store's Mnesia table.
Start the supervisor.
Retrieve the Mnesia table name used for the store.
Drop the table used for the store.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec create(Nostrum.Struct.Guild.id(), Nostrum.Struct.WSState.shard_num()) :: :ok
Create a new mapping for the given guild ID to the given shard ID.
@spec delete(Nostrum.Struct.Guild.id()) :: :ok
Delete any stored mapping for the given guild ID.
@spec get(Nostrum.Struct.Guild.id()) :: Nostrum.Struct.WSState.shard_num() | nil
Get the shard number for the given guild ID.
Set up the store's Mnesia table.
Start the supervisor.
@spec table() :: atom()
Retrieve the Mnesia table name used for the store.
@spec teardown() :: {:atomic, :ok} | {:aborted, term()}
Drop the table used for the store.