26#ifndef MYSQLROUTER_REST_API_PLUGIN_INCLUDED
27#define MYSQLROUTER_REST_API_PLUGIN_INCLUDED
33#include <shared_mutex>
51 std::list<std::tuple<std::regex, std::unique_ptr<BaseRestApiHandler>>>;
57 std::unique_ptr<BaseRestApiHandler>
handler);
93 std::tuple<std::string, std::regex, std::unique_ptr<BaseRestApiHandler>>>
a HTTP request and response.
Definition: http_request.h:453
void(*)(JsonDocument &spec_doc) SpecProcessor
processor for the RestAPI's spec.
Definition: rest_api_component.h:125
rapidjson::GenericDocument< rapidjson::UTF8<>, rapidjson::CrtAllocator > JsonDocument
Definition: rest_api_component.h:98
Definition: rest_api_plugin.h:35
RestApi(const std::string &uri_prefix, const std::string &uri_prefix_regex)
Definition: rest_api_plugin.cc:129
std::mutex spec_doc_mutex_
Definition: rest_api_plugin.h:96
void process_spec(RestApiComponent::SpecProcessor spec_processor)
process the spec's Json JsonDocument.
Definition: rest_api_plugin.cc:158
std::string uri_prefix_regex_
Definition: rest_api_plugin.h:89
void handle_paths(HttpRequest &req)
handle request for all register URI paths.
Definition: rest_api_plugin.cc:200
std::list< std::tuple< std::string, std::regex, std::unique_ptr< BaseRestApiHandler > > > rest_api_handlers_
Definition: rest_api_plugin.h:94
RestApi(const RestApi &)=delete
std::string spec()
get the spec as JSON.
Definition: rest_api_plugin.cc:164
std::shared_timed_mutex rest_api_handler_mutex_
Definition: rest_api_plugin.h:91
std::string uri_prefix_
Definition: rest_api_plugin.h:88
RestApi(RestApi &&)=delete
RestApiComponent::JsonDocument spec_doc_
Definition: rest_api_plugin.h:97
std::string uri_prefix() const
get the uri path prefix.
Definition: rest_api_plugin.h:75
std::list< std::tuple< std::regex, std::unique_ptr< BaseRestApiHandler > > > PathList
Definition: rest_api_plugin.h:51
void remove_path(const std::string &path)
remove handle for URI path.
Definition: rest_api_plugin.cc:190
RestApi & operator=(const RestApi &)=delete
void add_path(const std::string &path, std::unique_ptr< BaseRestApiHandler > handler)
add handler for URI path.
Definition: rest_api_plugin.cc:176
RestApi & operator=(RestApi &&)=delete
std::string uri_prefix_regex() const
get the regex for the URI path prefix.
Definition: rest_api_plugin.h:80
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4414
static char * path
Definition: mysqldump.cc:137
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2878