kura_tenant (kura v2.0.6)

View Source

Summary

Functions

Remove the current tenant strategy from the process dictionary.

Get the current tenant strategy from the process dictionary.

Set the current tenant strategy in the process dictionary.

Execute a function with a temporary tenant, restoring the previous tenant after.

Types

strategy()

-type strategy() :: {prefix, binary()} | {attribute, {atom(), term()}}.

Functions

clear_tenant()

-spec clear_tenant() -> undefined | strategy().

Remove the current tenant strategy from the process dictionary.

get_tenant()

-spec get_tenant() -> undefined | strategy().

Get the current tenant strategy from the process dictionary.

put_tenant(Tenant)

-spec put_tenant(strategy()) -> undefined | strategy().

Set the current tenant strategy in the process dictionary.

with_tenant(Tenant, Fun)

-spec with_tenant(strategy(), fun(() -> T)) -> T when T :: term().

Execute a function with a temporary tenant, restoring the previous tenant after.