OLLMrpc.Http


Description:

HTTP verb+path → RPC method and body GTypes.

Services call routes (or add) from rpc_register(). Transport.HttpServer looks up the route table and builds a Request for wire_name.method. Socket FFI still uses Request.add_class / Request.register; path registration fills the same method maps.

Usage Examples

Bulk from a service

OLLMrpc.Http.routes("Alarm", typeof(Service),
"/v1/alarms/{id}", "GET", "get", "s", typeof(void), typeof(void),
"/v1/alarms", "POST", "create", "o", typeof(AlarmCreate), typeof(Alarm),
"/v1/alarms/{id}", "DELETE", "remove", "s", typeof(void), typeof(void)
);
OLLMrpc.Request.register("Alarm", new Service());

One registration per verb+path. A trailing /{id} is stripped and sets Route.variable: the last segment is optional and becomes the first FFI s (empty when absent). A JSON body (if any) follows as o (sig "so").

One extra path

OLLMrpc.Http.add("Alarm", typeof(Service),
"/v1/alarms/ping", "GET", "ping", typeof(void), typeof(void)
);

Content:

Classes:

Functions: