Atex.IdentityResolver.Cache behaviour (atex v0.3.0)

View Source

Summary

Callbacks

Get the child specification for starting the cache in a supervision tree.

Delete an identity in the cache.

Retrieve an identity from the cache by DID or handle.

Add a new identity to the cache. Can also be used to update an identity that may already exist.

Functions

See Atex.IdentityResolver.Cache.ETS.get/1.

Callbacks

child_spec(any)

@callback child_spec(any()) :: Supervisor.child_spec()

Get the child specification for starting the cache in a supervision tree.

delete(t)

@callback delete(String.t()) :: :noop | Atex.IdentityResolver.Identity.t()

Delete an identity in the cache.

get(t)

@callback get(String.t()) :: {:ok, Atex.IdentityResolver.Identity.t()} | {:error, atom()}

Retrieve an identity from the cache by DID or handle.

insert(identity)

Add a new identity to the cache. Can also be used to update an identity that may already exist.

Returns the input Atex.IdentityResolver.Identity.t/0.

Functions

get(identifier)

See Atex.IdentityResolver.Cache.ETS.get/1.