26#ifndef MYSQLROUTER_HTTP_SERVER_COMPONENT_INCLUDED
27#define MYSQLROUTER_HTTP_SERVER_COMPONENT_INCLUDED
54 void init(std::shared_ptr<HttpServer>
srv);
55 void add_route(
const std::string &url_regex,
56 std::unique_ptr<BaseRequestHandler> cb);
57 void remove_route(
const std::string &url_regex);
66 std::unique_ptr<BaseRequestHandler>
handler;
72 std::weak_ptr<HttpServer>
srv_;
93 std::shared_ptr<HttpAuthRealm> realm);
static mysql_service_status_t init()
Component initialization.
Definition: audit_api_message_emit.cc:571
Definition: http_server_component.h:36
BaseRequestHandler & operator=(const BaseRequestHandler &)=delete
void call(HttpRequest &req, void *me)
Definition: http_server_component.h:38
virtual void handle_request(HttpRequest &req)=0
BaseRequestHandler(const BaseRequestHandler &)=delete
BaseRequestHandler()=default
virtual ~BaseRequestHandler()
Authentication Realm.
Definition: http_auth_realm.h:47
high-level Authentication frontend.
Definition: http_server_component.h:84
a HTTP request and response.
Definition: http_request.h:453
Definition: http_server_component.h:51
std::mutex rh_mu
Definition: http_server_component.h:69
HttpServerComponent(HttpServerComponent const &)=delete
std::weak_ptr< HttpServer > srv_
Definition: http_server_component.h:72
HttpServerComponent()=default
std::vector< RouterData > request_handlers_
Definition: http_server_component.h:70
void operator=(HttpServerComponent const &)=delete
Definition: http_server_plugin.h:124
#define HTTP_SERVER_EXPORT
Definition: http_server_export.h:40
Definition: srv0dynamic_procedures.h:48
Definition: http_server_component.h:64
std::string url_regex_str
Definition: http_server_component.h:65
std::unique_ptr< BaseRequestHandler > handler
Definition: http_server_component.h:66