View Source Nostrum.Cache.ChannelGuildMapping.Mnesia (Nostrum v0.9.0)

An Mnesia-based mapping between channel and guild IDs.

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 mapping of the given channel to the given guild.

Remove any mapping associated with the given channel.

Retrieve the guild ID for the given channel ID, if present.

Set up the ETS table.

Start the supervisor.

Retrieve the table used by this module.

Drop the table used for caching.

Functions

Link to this function

child_spec(init_arg)

View Source (since 0.8.0)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

create(channel_id, guild_id)

View Source (since 0.8.0)

Create a mapping of the given channel to the given guild.

Link to this function

delete(channel_id)

View Source (since 0.8.0)
@spec delete(Nostrum.Struct.Channel.id()) :: true

Remove any mapping associated with the given channel.

Link to this function

get(channel_id)

View Source (since 0.8.0)

Retrieve the guild ID for the given channel ID, if present.

Link to this function

init(init_arg)

View Source (since 0.8.0)

Set up the ETS table.

Link to this function

start_link(init_arg)

View Source (since 0.8.0)

Start the supervisor.

@spec table() :: atom()

Retrieve the table used by this module.

Link to this function

teardown()

View Source (since 0.8.0)
@spec teardown() :: {:atomic, :ok} | {:aborted, term()}

Drop the table used for caching.