View Source Nostrum.Store.GuildShardMapping.ETS (Nostrum v0.10.0)

Maintains a mapping of guild IDs to their shard numbers using :ets.

If programmatic access to the ETS table is needed, please use the table/0 function.

Please do not use this module directly, apart from special functions such as table/0. Use Nostrum.Store.GuildShardMapping to call the configured mapping instead.

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 ETS table.

Start the supervisor.

Retrieve the ETS table reference used for the store.

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(guild_id, shard_num)

View Source (since 0.8.0)

Create a new mapping for the given guild ID to the given shard ID.

Link to this function

delete(guild_id)

View Source (since 0.8.0)
@spec delete(Nostrum.Struct.Guild.id()) :: :ok

Delete any stored mapping for the given guild ID.

Link to this function

get(guild_id)

View Source (since 0.8.0)

Get the shard number for the given guild ID.

Link to this function

init(init_arg)

View Source (since 0.8.0)

Set up the store's ETS table.

Link to this function

start_link(init_arg)

View Source (since 0.8.0)

Start the supervisor.

@spec table() :: :ets.table()

Retrieve the ETS table reference used for the store.