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>>>
void(*)(JsonDocument &spec_doc) SpecProcessor
processor for the RestAPI's spec.
Definition: rest_api_component.h:126
rapidjson::GenericDocument< rapidjson::UTF8<>, rapidjson::CrtAllocator > JsonDocument
Definition: rest_api_component.h:99
Definition: rest_api_plugin.h:35
RestApi(const std::string &uri_prefix, const std::string &uri_prefix_regex)
Definition: rest_api_plugin.cc:133
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:162
std::string uri_prefix_regex_
Definition: rest_api_plugin.h:89
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:168
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 handle_paths(http::base::Request &req)
handle request for all register URI paths.
Definition: rest_api_plugin.cc:204
void remove_path(const std::string &path)
remove handle for URI path.
Definition: rest_api_plugin.cc:194
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:180
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:4583
static char * path
Definition: mysqldump.cc:149
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2880