Lux.Company.Hub behaviour (Lux v0.5.0)
View SourceDefines the behaviour for company hubs.
Company hubs manage the registration and discovery of companies. They provide:
- Company registration and lookup
- Search functionality
- Basic company lifecycle management
Summary
Callbacks
Deregisters a company from the hub.
Gets a company by its ID.
Lists all registered companies.
Registers a company in the hub. Accepts either a module implementing the company behavior or a company struct. Returns the unique company ID on success.
Searches for companies based on criteria. Supports searching by name, mission, or other attributes.
Types
Callbacks
@callback deregister_company(company_id(), hub :: GenServer.server()) :: :ok | {:error, term()}
Deregisters a company from the hub.
@callback get_company(company_id(), hub :: GenServer.server()) :: {:ok, Lux.Company.t()} | {:error, term()}
Gets a company by its ID.
@callback list_companies(hub :: GenServer.server()) :: {:ok, [Lux.Company.t()]} | {:error, term()}
Lists all registered companies.
@callback register_company(company_module() | Lux.Company.t(), hub :: GenServer.server()) :: {:ok, company_id()} | {:error, term()}
Registers a company in the hub. Accepts either a module implementing the company behavior or a company struct. Returns the unique company ID on success.
@callback search_companies( query :: String.t(), hub :: GenServer.server(), opts :: search_opts() ) :: {:ok, [Lux.Company.t()]} | {:error, term()}
Searches for companies based on criteria. Supports searching by name, mission, or other attributes.