Incant.Service.Registry (Incant v0.1.1)

Copy Markdown View Source

Runtime registry for remotely discovered Incant services.

The registry is the central-admin side of the HostKit/SafeRPC/Incant flow:

  • HostKit provides an ETF binding term path in HOSTKIT_RPC_BINDINGS.
  • Incant decodes the local HostKit-generated term from a trusted file.
  • SafeRPC descriptors identify modules exposing the Incant service shape.
  • Incant calls describe for each service and stores the resulting contract.

No service-specific modules are hardcoded by the central Incant admin.

Summary

Functions

Decodes a trusted local HostKit/SafeRPC binding ETF term.

Builds a registry from an already decoded HostKit/SafeRPC binding term.

Loads a registry from the HOSTKIT_RPC_BINDINGS environment variable.

Loads a registry from a HostKit/SafeRPC binding ETF file.

Types

t()

@type t() :: %Incant.Service.Registry{
  bindings: SafeRPC.local_bindings() | [SafeRPC.local_binding()],
  entries: [Incant.Service.Entry.t()],
  source: {:env, String.t(), Path.t()} | {:file, Path.t()} | :bindings
}

Functions

decode_bindings(binary)

@spec decode_bindings(binary()) :: {:ok, SafeRPC.local_bindings()} | {:error, term()}

Decodes a trusted local HostKit/SafeRPC binding ETF term.

from_bindings(bindings, opts \\ [])

@spec from_bindings(
  SafeRPC.local_bindings() | [SafeRPC.local_binding()],
  keyword()
) :: {:ok, t()} | {:error, term()}

Builds a registry from an already decoded HostKit/SafeRPC binding term.

load(opts \\ [])

@spec load(keyword()) :: {:ok, t()} | {:error, term()}

Loads a registry from the HOSTKIT_RPC_BINDINGS environment variable.

load_file(path, opts \\ [])

@spec load_file(
  Path.t(),
  keyword()
) :: {:ok, t()} | {:error, term()}

Loads a registry from a HostKit/SafeRPC binding ETF file.