View Source Nostrum.Cache.ChannelCache.ETS (Nostrum v0.7.0-rc1)

An ETS-based cache for channels outside of guilds.

The supervisor defined by this module will set up the ETS table associated with it.

The default table name under which channels are cached is nostrum_channels. 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.ChannelCache directly, which will dispatch to the configured cache.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Converts and creates the given map as a channel in the cache.

Delete the channel from the cache by ID.

Retrieve a channel from the cache by ID.

Set up the cache's ETS table.

Lookup a channel from the cache by ID and if it does not exist try to get from GuildCache with select_by

Start the supervisor.

Retrieve the ETS table name used for the cache.

Update the given channel in the cache.

Link to this section Functions

Link to this function

child_spec(init_arg)

View Source (since 0.5.0)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

create(channel)

View Source (since 0.5.0)
@spec create(map()) :: Nostrum.Struct.Channel.t()

Converts and creates the given map as a channel in the cache.

Link to this function

delete(id)

View Source (since 0.5.0)

Delete the channel from the cache by ID.

Retrieve a channel from the cache by ID.

Link to this function

init(init_arg)

View Source (since 0.5.0)

Set up the cache's ETS table.

Link to this function

lookup(id)

View Source (since 0.5.0)
@spec lookup(Nostrum.Struct.Channel.id()) ::
  {:error, :channel_not_found} | {:ok, map()}

Lookup a channel from the cache by ID and if it does not exist try to get from GuildCache with select_by

Link to this function

start_link(init_arg)

View Source (since 0.5.0)

Start the supervisor.

@spec tabname() :: atom()

Retrieve the ETS table name used for the cache.

Link to this function

update(channel)

View Source (since 0.5.0)

Update the given channel in the cache.