6 #ifndef KAGOME_API_JRPC_SERVER_HPP 7 #define KAGOME_API_JRPC_SERVER_HPP 11 #include <jsonrpc-lean/dispatcher.h> 12 #include <jsonrpc-lean/response.h> 13 #include <jsonrpc-lean/value.h> 25 using Method = jsonrpc::MethodWrapper::Method;
46 std::function<void(outcome::result<std::string_view>)>;
55 const jsonrpc::Request::Parameters &from,
69 #endif // KAGOME_API_JRPC_SERVER_HPP 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
std::function< void(outcome::result< std::string_view >)> FormatterHandler
virtual void registerHandler(const std::string &name, Method method)=0
registers rpc request handler lambda
std::function< void(std::string_view)> ResponseHandler
jsonrpc::MethodWrapper::Method Method
virtual ~JRpcServer()=default
virtual void processData(std::string_view request, const ResponseHandler &cb)=0
handles decoded network message