Skip to content
Snippets Groups Projects
Commit 414e0a2e authored by Adrien Béraud's avatar Adrien Béraud
Browse files

proxy server: move type traits definition to cpp

parent e0393ff8
No related branches found
No related tags found
No related merge requests found
...@@ -52,28 +52,6 @@ namespace restinio { ...@@ -52,28 +52,6 @@ namespace restinio {
struct custom_http_methods_t; struct custom_http_methods_t;
} }
using RestRouter = restinio::router::express_router_t<>;
struct RestRouterTraitsTls : public restinio::default_tls_traits_t
{
using timer_manager_t = restinio::asio_timer_manager_t;
using http_methods_mapper_t = restinio::custom_http_methods_t;
using logger_t = restinio::opendht_logger_t;
using request_handler_t = RestRouter;
using connection_state_listener_t = http::ConnectionListener;
};
struct RestRouterTraits : public restinio::default_traits_t
{
using timer_manager_t = restinio::asio_timer_manager_t;
using http_methods_mapper_t = restinio::custom_http_methods_t;
using logger_t = restinio::opendht_logger_t;
using request_handler_t = RestRouter;
using connection_state_listener_t = http::ConnectionListener;
};
using RequestStatus = restinio::request_handling_status_t;
using ResponseByParts = restinio::chunked_output_t;
using ResponseByPartsBuilder = restinio::response_builder_t<ResponseByParts>;
namespace Json { namespace Json {
class Value; class Value;
} }
...@@ -82,6 +60,13 @@ namespace dht { ...@@ -82,6 +60,13 @@ namespace dht {
class DhtRunner; class DhtRunner;
using RestRouter = restinio::router::express_router_t<>;
struct RestRouterTraitsTls;
struct RestRouterTraits;
using RequestStatus = restinio::request_handling_status_t;
using ResponseByParts = restinio::chunked_output_t;
using ResponseByPartsBuilder = restinio::response_builder_t<ResponseByParts>;
/** /**
* Describes the REST API * Describes the REST API
*/ */
......
...@@ -46,6 +46,27 @@ constexpr char RESP_MSG_PUT_FAILED[] = "{\"err\":\"Put failed\"}"; ...@@ -46,6 +46,27 @@ constexpr char RESP_MSG_PUT_FAILED[] = "{\"err\":\"Put failed\"}";
constexpr const std::chrono::minutes PRINT_STATS_PERIOD {2}; constexpr const std::chrono::minutes PRINT_STATS_PERIOD {2};
struct RestRouterTraitsTls : public restinio::default_tls_traits_t
{
using timer_manager_t = restinio::asio_timer_manager_t;
#ifdef OPENDHT_PROXY_HTTP_PARSER_FORK
using http_methods_mapper_t = restinio::custom_http_methods_t;
#endif
using logger_t = restinio::opendht_logger_t;
using request_handler_t = RestRouter;
using connection_state_listener_t = http::ConnectionListener;
};
struct RestRouterTraits : public restinio::default_traits_t
{
using timer_manager_t = restinio::asio_timer_manager_t;
#ifdef OPENDHT_PROXY_HTTP_PARSER_FORK
using http_methods_mapper_t = restinio::custom_http_methods_t;
#endif
using logger_t = restinio::opendht_logger_t;
using request_handler_t = RestRouter;
using connection_state_listener_t = http::ConnectionListener;
};
DhtProxyServer::DhtProxyServer( DhtProxyServer::DhtProxyServer(
std::shared_ptr<dht::crypto::Identity> identity, std::shared_ptr<dht::crypto::Identity> identity,
std::shared_ptr<DhtRunner> dht, in_port_t port, const std::string& pushServer, std::shared_ptr<DhtRunner> dht, in_port_t port, const std::string& pushServer,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment