macula_gateway_diagnostics (macula v0.20.5)

View Source

Macula Gateway Diagnostics Service

Provides simple diagnostic procedures that clients can call to verify connectivity and test the gateway's RPC functionality.

Available procedures: - com.macula.diagnostics.hello - Returns a friendly greeting with gateway info - com.macula.diagnostics.echo - Echoes back the arguments sent by client - com.macula.diagnostics.info - Returns detailed gateway information

Usage: The diagnostics service automatically registers when the gateway starts. Clients can call these procedures using the Macula SDK:

Elixir: {:ok, result} = MaculaSdk.Client.call(client, "com.macula.diagnostics.hello", %{})

Result: %{ "message" => "Hello from Macula Gateway!", "gateway" => "macula@127.0.0.1", "realm" => "com.example.realm", "uptime_seconds" => 42, "timestamp" => 1699612800 }

Summary

Functions

handle_call(Request, From, State)

handle_cast(Request, State)

handle_info(Info, State)

init(Opts)

register_procedures(GatewayPid)

-spec register_procedures(pid()) -> ok.

Register diagnostic procedures with the gateway

start_link(Opts)

-spec start_link(proplists:proplist()) -> {ok, pid()} | {error, term()}.

Start the diagnostics service

terminate(Reason, State)