Module iroh_server

Module iroh_server 

Source

Structs§

Handlers
Helper struct for registering handlers that are called by the Iroh Endpoint. GET handlers and POST handlers are registered separately, since they contain different function signatures. If a route is authenticated, it is also stored in authenticated_routes which is checked when the specific handler is called.

Functions§

handle_incoming_iroh_request 🔒
Handle a specific Iroh request. The request must be deserialized, matched to a handler, executed, then return a response to the caller.
handle_request 🔒
Checks if the requested route is authenticated and will reject the request if the authentication is incorrect. Then it will lookup the specific handler in Handlers, execute it, and return the function’s JSON along with an HTTP status code.
iroh_verify_password 🔒
Verifies if the supplied password in the Iroh request matches the gateway’s password
make_get_handler 🔒
Creates a GET handler for the Iroh endpoint by wrapping it in a closure.
make_post_handler 🔒
Creates a POST handler for the Iroh endpoint by wrapping it in a closure.
start_iroh_endpoint
Create the Iroh Endpoint and spawn a thread that starts listening for requests.

Type Aliases§

GetHandler 🔒
Handler for a GET request, which must contain no parameters and return serde_json::Value
PostHandler 🔒
Handler for a POST request, which must contain serde_json::Value encoded parameters and return serde_json::Value.