Raxol.Core.GlobalRegistry.RegistryBehaviour behaviour (Raxol v2.0.1)

View Source

Behaviour for unified registry operations.

Summary

Types

entry_data()

@type entry_data() :: any()

entry_id()

@type entry_id() :: String.t() | atom()

registry_type()

@type registry_type() :: :sessions | :plugins | :commands | :themes | :components

Callbacks

count(registry_type)

@callback count(registry_type()) :: non_neg_integer()

list(registry_type)

@callback list(registry_type()) :: [entry_data()]

lookup(registry_type, entry_id)

@callback lookup(registry_type(), entry_id()) ::
  {:ok, entry_data()} | {:error, :not_found}

register(registry_type, entry_id, entry_data)

@callback register(registry_type(), entry_id(), entry_data()) :: :ok | {:error, term()}

search(registry_type, t)

@callback search(registry_type(), String.t()) :: [entry_data()]

unregister(registry_type, entry_id)

@callback unregister(registry_type(), entry_id()) :: :ok | {:error, term()}