Amarula.Protocol.Signal.LIDMappingStore (amarula v0.1.0)
View SourceLID mapping store for managing Phone Number to Local ID mappings.
This store handles the conversion between PN (Phone Number) JIDs and LID (Local ID) JIDs using caching and persistent storage. It supports both forward (PN → LID) and reverse (LID → PN) mappings.
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets LID for a single PN.
Gets LIDs for multiple PNs.
Gets PN for a LID.
Starts the LID mapping store.
Stores LID-PN mappings.
Types
@type pn_to_lid_func() :: ([String.t()] -> {:ok, [Amarula.Protocol.Signal.LIDMapping.t()]} | {:error, String.t()})
@type t() :: %Amarula.Protocol.Signal.LIDMappingStore{ cache: :ets.tid(), key_store: module(), logger: module(), pn_to_lid_func: pn_to_lid_func() | nil }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec get_lid_for_pn(GenServer.server(), String.t()) :: {:ok, String.t()} | {:error, String.t()}
Gets LID for a single PN.
@spec get_lids_for_pns(GenServer.server(), [String.t()]) :: {:ok, [Amarula.Protocol.Signal.LIDMapping.t()]} | {:error, String.t()}
Gets LIDs for multiple PNs.
@spec get_pn_for_lid(GenServer.server(), String.t()) :: {:ok, String.t()} | {:error, String.t()}
Gets PN for a LID.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the LID mapping store.
@spec store_lid_pn_mappings(GenServer.server(), [ Amarula.Protocol.Signal.LIDMapping.t() ]) :: :ok | {:error, String.t()}
Stores LID-PN mappings.