Packages

Provides a full user authentication experience for an API. Includes login,logout,register,forgot password, forgot username, confirmation email and all that other good stuff. Includes plug for checking for authenticated users and macro for generating the required routes.

Current section

Files

Jump to
access_pass lib access_pass helpers ets_distributed.ex
Raw

lib/access_pass/helpers/ets_distributed.ex

defmodule AccessPass.EtsDistributed do
def insert(name, obj,true) do
:ets.insert(name, obj)
end
def insert(name, obj) do
:ets.insert(name, obj)
replicate(name,obj)
end
defdelegate delete(name,key), to: AccessPass.Ets
defdelegate match_object(name,object), to: AccessPass.Ets
defdelegate match_delete(name,obj), to: AccessPass.Ets
defdelegate match(name,obj), to: AccessPass.Ets
defdelegate new(name,opts), to: AccessPass.Ets
defp replicate(name,obj) do
Task.start(fn ->
Node.list() |> :rpc.multicall(AccessPass.Ets, :insert, [name,obj])
end)
end
end