Kagome
Polkadot Runtime Engine in C++17
|
#include <jrpc_server.hpp>
Public Types | |
using | Method = jsonrpc::MethodWrapper::Method |
using | ResponseHandler = std::function< void(std::string_view)> |
using | FormatterHandler = std::function< void(outcome::result< std::string_view >)> |
Public Member Functions | |
virtual | ~JRpcServer ()=default |
virtual void | registerHandler (const std::string &name, Method method)=0 |
registers rpc request handler lambda More... | |
virtual std::vector< std::string > | getHandlerNames ()=0 |
virtual void | processJsonData (std::string method_name, const jsonrpc::Request::Parameters &from, const FormatterHandler &cb)=0 |
creates valid jsonrpc response More... | |
virtual void | processData (std::string_view request, const ResponseHandler &cb)=0 |
handles decoded network message More... | |
Instance of json rpc server, allows to register callbacks for rpc methods and then invoke them
Definition at line 23 of file jrpc_server.hpp.
using kagome::api::JRpcServer::FormatterHandler = std::function<void(outcome::result<std::string_view>)> |
Definition at line 46 of file jrpc_server.hpp.
using kagome::api::JRpcServer::Method = jsonrpc::MethodWrapper::Method |
Definition at line 25 of file jrpc_server.hpp.
using kagome::api::JRpcServer::ResponseHandler = std::function<void(std::string_view)> |
Response callback type
Definition at line 44 of file jrpc_server.hpp.
|
virtualdefault |
|
pure virtual |
Implemented in kagome::api::JRpcServerImpl.
|
pure virtual |
handles decoded network message
request | json request string |
cb | callback |
Implemented in kagome::api::JRpcServerImpl.
|
pure virtual |
creates valid jsonrpc response
method_name | is a name of the method in jsonrpc call |
from | is a data source |
cb | callback |
Implemented in kagome::api::JRpcServerImpl.
|
pure virtual |
registers rpc request handler lambda
name | rpc method name |
method | handler functor |
Implemented in kagome::api::JRpcServerImpl.