Behaviour for service-owned Incant admin surfaces.
use Incant.Admin, rpc: true implements this behaviour and exposes it through
SafeRPC. Application modules should usually use the Incant admin DSL instead
of implementing this behaviour by hand.
Central Incant admin applications can discover Incant service modules from a
HostKit/SafeRPC binding term, then use %Incant.Service.Client{} handles to
call the standard Incant service verbs without repeating SafeRPC operation
tuples at every call site.
Summary
Functions
Builds a client handle for a discovered Incant service module.
Calls the remote Incant service describe verb.
Discovers Incant service clients from HostKit/SafeRPC local bindings.
Calls the remote Incant service index verb.
Calls the remote Incant service read verb.
Calls the remote Incant service run_action verb.
Calls the remote Incant service run_widget verb.
Callbacks
Functions
@spec client(SafeRPC.local_binding() | Incant.Service.Client.endpoint(), [ {:module, module()} ]) :: Incant.Service.Client.t()
Builds a client handle for a discovered Incant service module.
The first argument may be a HostKit/SafeRPC local binding map containing a
:socket key, or an already-started SafeRPC client process/name. Pass the
service module with :module.
@spec describe(Incant.Service.Client.t(), Incant.Service.Describe.t(), keyword()) :: {:ok, term()} | {:error, term()}
Calls the remote Incant service describe verb.
@spec discover( SafeRPC.local_bindings() | [SafeRPC.local_binding()], keyword() ) :: {:ok, [Incant.Service.Client.t()]} | {:error, term()}
Discovers Incant service clients from HostKit/SafeRPC local bindings.
Each HostKit binding provides trusted local candidate modules. Incant probes
those candidates by calling the standard describe operation and returns the
modules that answer with an Incant admin contract.
@spec index(Incant.Service.Client.t(), Incant.Service.Index.t(), keyword()) :: {:ok, map()} | {:error, term()}
Calls the remote Incant service index verb.
@spec read(Incant.Service.Client.t(), Incant.Service.Read.t(), keyword()) :: {:ok, term()} | {:error, term()}
Calls the remote Incant service read verb.
@spec run_action(Incant.Service.Client.t(), Incant.Service.RunAction.t(), keyword()) :: {:ok, Incant.ActionResult.t()} | {:error, term()}
Calls the remote Incant service run_action verb.
@spec run_widget(Incant.Service.Client.t(), Incant.Service.RunWidget.t(), keyword()) :: {:ok, term()} | {:error, term()}
Calls the remote Incant service run_widget verb.