Elixir v0.2.1 Nostrum.Cache.UserCache
Cache for users.
The ETS table name associated with the User Cache is :users
. Besides the
methods provided below you can call any other ETS methods on the table.
Example
info = :ets.info(:users)
[..., heir: :none, name: :users, size: 1, ...]
size = info[:size]
1
Summary
Functions
Retrieves a user from the cache.
get/1
requires a keyword list as its only argument.
Returns {:ok, Nostrum.Struct.User.t} if found, {:error, atom} otherwise.
Example
case Nostrum.Cache.User.get(id: 1111222233334444) do
{:ok, user} ->
"We found " <> user.username
{:error, _reason} ->
"No es bueno"
end
Retrieves a user from the cache.
See get/1
for use and examples.
Returns Nostrum.Struct.User.t
if found.
Raises Nostrum.Error.CahceError
if not found.