ProtoRune.XRPC.Procedure (proto_rune v0.1.0)
The XRPC.Procedure
module represents a procedure in the XRPC system, encapsulating the method name, request body, and a parser for validating the body. It provides functions to create and manipulate procedure structures.
Overview
This module allows for:
- Creating Procedures: Use the
new/2
function to create a new procedure with a method and a parser. - Adding a Body: Use the
put_body/2
function to attach a validated body to the procedure. - String Representation: The procedure can be converted to a string that represents its full URL.
Functions
new/2
Creates a new procedure with a given method and parser.
XRPC.Procedure.new("app.bsky.actor.mute", from: MyParser)
put_body/2
Attaches a validated body to the procedure.
{:ok, updated_proc} = XRPC.Procedure.put_body(proc, %{"actor_id" => "123"})
Validates the body using the specified parser and updates the procedure via peri.
Summary
Functions
Link to this function
new(method)
Link to this function
new(method, list)
Link to this function
put_body(proc, body)
Link to this function