Skip to main content

Module protocol

Module protocol 

Source
Expand description

Length-prefixed JSON-RPC wire types for subprocess communication.

Confium spawns each plugin as a child process. The host writes Request frames to the plugin’s stdin and reads Response frames from its stdout. Every frame is prefixed with a 4-byte big-endian length followed by that many bytes of UTF-8 JSON.

The request envelope is intentionally minimal:

{"method": "<function>", "args": [<value>, ...]}

Responses carry exactly one of result or error:

{"result": [<value>, ...]}            // success
{"error": {"message": "<text>"}}      // failure

Value variants map to/from JSON as documented on value_to_json and value_from_json.

Structs§

Request
A request the host sends to the plugin subprocess.
Response
A response the plugin writes back to the host.
ResponseError
Error payload inside a Response.

Functions§

value_from_json
Inverse of value_to_json.
value_to_json
Marshal a Value to its JSON wire form.