2020-05-21 16:09:45 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string_view>
|
2023-01-20 19:15:18 +01:00
|
|
|
#include <llarp/config/config.hpp>
|
2021-02-02 15:35:40 +01:00
|
|
|
#include <oxenmq/oxenmq.h>
|
|
|
|
#include <oxenmq/address.h>
|
2022-09-28 18:37:19 +02:00
|
|
|
#include <oxen/log/omq_logger.hpp>
|
2020-05-21 16:09:45 +02:00
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
struct AbstractRouter;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace llarp::rpc
|
|
|
|
{
|
2021-02-03 19:12:21 +01:00
|
|
|
using LMQ_ptr = std::shared_ptr<oxenmq::OxenMQ>;
|
2020-05-21 16:09:45 +02:00
|
|
|
|
|
|
|
struct RpcServer
|
|
|
|
{
|
|
|
|
explicit RpcServer(LMQ_ptr, AbstractRouter*);
|
|
|
|
~RpcServer() = default;
|
2023-01-20 19:15:18 +01:00
|
|
|
|
2020-05-21 16:09:45 +02:00
|
|
|
void
|
2023-01-20 19:15:18 +01:00
|
|
|
AddRPCCategories();
|
2020-05-21 16:09:45 +02:00
|
|
|
|
|
|
|
private:
|
2022-09-28 18:37:19 +02:00
|
|
|
void
|
|
|
|
HandleLogsSubRequest(oxenmq::Message& m);
|
|
|
|
|
2020-05-21 16:09:45 +02:00
|
|
|
LMQ_ptr m_LMQ;
|
|
|
|
AbstractRouter* const m_Router;
|
2022-09-28 18:37:19 +02:00
|
|
|
|
|
|
|
oxen::log::PubsubLogger log_subs;
|
2020-05-21 16:09:45 +02:00
|
|
|
};
|
|
|
|
} // namespace llarp::rpc
|