mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-18 08:02:29 +00:00
Add JSON-RPC capability
Inline nlohmann/json for the JSON parsing itself, and handle requests with the same SCGI interface as XML-RPC. Based off the work in https://github.com/jesec/rtorrent
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#ifndef RTORRENT_RPC_JSONRPC_H
|
||||
#define RTORRENT_RPC_JSONRPC_H
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace rpc {
|
||||
|
||||
class JsonRpc {
|
||||
public:
|
||||
using slot_write = std::function<bool(const char*, uint32_t)>;
|
||||
|
||||
void initialize() {};
|
||||
void cleanup() {};
|
||||
|
||||
bool process(const char* in_buffer, uint32_t length, slot_write callback);
|
||||
|
||||
void insert_command(const char* name, const char* parm, const char* doc) {};
|
||||
};
|
||||
|
||||
} // namespace rpc
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user