Current section
Files
Jump to
Current section
Files
doc/cloudi_json_rpc.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Module cloudi_json_rpc</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<hr>
<h1>Module cloudi_json_rpc</h1>
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#types">Data Types</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
<h3><a name="CloudI_JSON_RPC">CloudI JSON RPC</a></h3>
Implementation based on the version 2.0 of the JSON-RPC specification.
<p>Copyright © 2011-2020 Michael Truog</p>
<p><b>Version:</b> 2.0.1 Jun 20 2023 18:43:54
------------------------------------------------------------------------</p>
<p><b>Authors:</b> Michael Truog (<a href="mailto:mjtruog at protonmail dot com"><tt>mjtruog at protonmail dot com</tt></a>).</p>
<h2><a name="description">Description</a></h2>
<h3><a name="CloudI_JSON_RPC">CloudI JSON RPC</a></h3>
Implementation based on the version 2.0 of the JSON-RPC specification.
Named parameters are not supported to ensure parameters always have
an implicit order. Batch requests are not supported.
<h2><a name="types">Data Types</a></h2>
<h3 class="typedecl"><a name="type-error_code">error_code()</a></h3>
<p><tt>error_code() = integer()</tt></p>
<h3 class="typedecl"><a name="type-error_message">error_message()</a></h3>
<p><tt>error_message() = binary()</tt></p>
<h3 class="typedecl"><a name="type-id">id()</a></h3>
<p><tt>id() = binary() | integer() | null</tt></p>
<h3 class="typedecl"><a name="type-method">method()</a></h3>
<p><tt>method() = binary()</tt></p>
<h3 class="typedecl"><a name="type-params">params()</a></h3>
<p><tt>params() = list()</tt></p>
<h3 class="typedecl"><a name="type-result">result()</a></h3>
<p><tt>result() = any()</tt></p>
<h2><a name="index">Function Index</a></h2>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#error_internal_error-1">error_internal_error/1</a></td><td>
<h4><a name="Internal_JSON-RPC_error.">Internal JSON-RPC error.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#error_invalid_params-1">error_invalid_params/1</a></td><td>
<h4><a name="Invalid_method_parameter(s).">Invalid method parameter(s).</a></h4>.</td></tr>
<tr><td valign="top"><a href="#error_invalid_request-0">error_invalid_request/0</a></td><td>
<h4><a name="The_JSON_sent_is_not_a_valid_Request_object.">The JSON sent is not a valid Request object.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#error_method_not_found-1">error_method_not_found/1</a></td><td>
<h4><a name="The_method_does_not_exist_/_is_not_available.">The method does not exist / is not available.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#error_parsing-0">error_parsing/0</a></td><td>
<h4><a name="Invalid_JSON_was_received_by_the_server.">Invalid JSON was received by the server.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#request_to_json-2">request_to_json/2</a></td><td>
<h4><a name="Create_a_JSON-RPC_request_in_a_JSON_binary.">Create a JSON-RPC request in a JSON binary.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#request_to_json-3">request_to_json/3</a></td><td>
<h4><a name="Create_a_JSON-RPC_request_with_parameters_in_a_JSON_binary.">Create a JSON-RPC request with parameters in a JSON binary.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#request_to_term-1">request_to_term/1</a></td><td>
<h4><a name="Parse_a_JSON-RPC_request_to_create_Erlang_terms.">Parse a JSON-RPC request to create Erlang terms.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#response_to_json-2">response_to_json/2</a></td><td>
<h4><a name="Create_a_JSON-RPC_response_in_a_JSON_binary.">Create a JSON-RPC response in a JSON binary.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#response_to_json-4">response_to_json/4</a></td><td>
<h4><a name="Create_a_JSON-RPC_error_response_in_a_JSON_binary.">Create a JSON-RPC error response in a JSON binary.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#response_to_term-1">response_to_term/1</a></td><td>
<h4><a name="Parse_a_JSON-RPC_response_to_create_Erlang_terms.">Parse a JSON-RPC response to create Erlang terms.</a></h4>.</td></tr>
</table>
<h2><a name="functions">Function Details</a></h2>
<h3 class="function"><a name="error_internal_error-1">error_internal_error/1</a></h3>
<div class="spec">
<p><tt>error_internal_error(Id::<a href="#type-id">id()</a>) -> binary()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Internal_JSON-RPC_error.">Internal JSON-RPC error.</a></h4>
</p>
<h3 class="function"><a name="error_invalid_params-1">error_invalid_params/1</a></h3>
<div class="spec">
<p><tt>error_invalid_params(Id::<a href="#type-id">id()</a>) -> binary()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Invalid_method_parameter(s).">Invalid method parameter(s).</a></h4>
</p>
<h3 class="function"><a name="error_invalid_request-0">error_invalid_request/0</a></h3>
<div class="spec">
<p><tt>error_invalid_request() -> binary()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="The_JSON_sent_is_not_a_valid_Request_object.">The JSON sent is not a valid Request object.</a></h4>
</p>
<h3 class="function"><a name="error_method_not_found-1">error_method_not_found/1</a></h3>
<div class="spec">
<p><tt>error_method_not_found(Id::<a href="#type-id">id()</a>) -> binary()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="The_method_does_not_exist_/_is_not_available.">The method does not exist / is not available.</a></h4>
</p>
<h3 class="function"><a name="error_parsing-0">error_parsing/0</a></h3>
<div class="spec">
<p><tt>error_parsing() -> binary()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Invalid_JSON_was_received_by_the_server.">Invalid JSON was received by the server.</a></h4>
</p>
<h3 class="function"><a name="request_to_json-2">request_to_json/2</a></h3>
<div class="spec">
<p><tt>request_to_json(Method::atom() | string() | binary(), Id::<a href="#type-id">id()</a>) -> binary()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Create_a_JSON-RPC_request_in_a_JSON_binary.">Create a JSON-RPC request in a JSON binary.</a></h4>
</p>
<h3 class="function"><a name="request_to_json-3">request_to_json/3</a></h3>
<div class="spec">
<p><tt>request_to_json(Method::atom() | string() | binary(), Params::<a href="#type-params">params()</a>, Id::<a href="#type-id">id()</a>) -> binary()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Create_a_JSON-RPC_request_with_parameters_in_a_JSON_binary.">Create a JSON-RPC request with parameters in a JSON binary.</a></h4>
</p>
<h3 class="function"><a name="request_to_term-1">request_to_term/1</a></h3>
<div class="spec">
<p><tt>request_to_term(Data::binary()) -> {<a href="#type-method">method()</a>, <a href="#type-params">params()</a>, <a href="#type-id">id()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Parse_a_JSON-RPC_request_to_create_Erlang_terms.">Parse a JSON-RPC request to create Erlang terms.</a></h4>
</p>
<h3 class="function"><a name="response_to_json-2">response_to_json/2</a></h3>
<div class="spec">
<p><tt>response_to_json(Result::<a href="#type-result">result()</a>, Id::<a href="#type-id">id()</a>) -> binary()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Create_a_JSON-RPC_response_in_a_JSON_binary.">Create a JSON-RPC response in a JSON binary.</a></h4>
</p>
<h3 class="function"><a name="response_to_json-4">response_to_json/4</a></h3>
<div class="spec">
<p><tt>response_to_json(Result::<a href="#type-result">result()</a> | null, ErrorCode::<a href="#type-error_code">error_code()</a> | null, ErrorMessage::<a href="#type-error_message">error_message()</a> | null, Id::<a href="#type-id">id()</a>) -> binary()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Create_a_JSON-RPC_error_response_in_a_JSON_binary.">Create a JSON-RPC error response in a JSON binary.</a></h4>
</p>
<h3 class="function"><a name="response_to_term-1">response_to_term/1</a></h3>
<div class="spec">
<p><tt>response_to_term(Data::binary()) -> {<a href="#type-result">result()</a>, <a href="#type-error_code">error_code()</a> | null, <a href="#type-error_message">error_message()</a> | null, <a href="#type-id">id()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Parse_a_JSON-RPC_response_to_create_Erlang_terms.">Parse a JSON-RPC response to create Erlang terms.</a></h4>
</p>
<hr>
<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc</i></p>
</body>
</html>