crux_cache v0.2.0 Crux.Cache.Guild View Source

Default Crux.Structs.Channel cache.

Unlike other caches this one splits up to different guild processes handling their data individually.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Deletes a:

Fetches a guild from the cache by id

Fetches a guild from the cache by id, raises if not found

Looks up the pid/0 of a Crux.Cache.Guild's GenServer by guild id

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

delete(data_or_id) View Source
delete(
  data_or_id ::
    Crux.Rest.snowflake()
    | Crux.Structs.Guild.t()
    | Crux.Structs.Channel.t()
    | Crux.Structs.Role.t()
    | Crux.Structs.Member.t()
) :: :ok

Deletes a:

Link to this function

fetch(guild_id) View Source
fetch(guild_id :: Crux.Rest.snowflake()) ::
  {:ok, Crux.Structs.Guild.t()} | :error

Fetches a guild from the cache by id.

Link to this function

fetch!(guild_id) View Source
fetch!(guild_id :: Crux.Rest.snowflake()) ::
  Crux.Structs.Guild.t() | no_return()

Fetches a guild from the cache by id, raises if not found.

Link to this function

insert(data) View Source
insert(data :: term()) :: term()

Inserts a:

Link to this function

lookup(guild_id) View Source
lookup(guild_id :: Crux.Rest.snowflake()) :: {:ok, pid()} | :error

Looks up the pid/0 of a Crux.Cache.Guild's GenServer by guild id.

Link to this function

update(data) View Source
update(data :: term()) :: term()

Updates or inserts a: