MySQL 8.0.39
Source Code Documentation
HttpRequestRouter Class Reference

#include <http_server_plugin.h>

Classes

struct  RouterData
 

Public Member Functions

void append (const std::string &url_regex_str, std::unique_ptr< BaseRequestHandler > cb)
 request router More...
 
void remove (const std::string &url_regex_str)
 
void route_default (HttpRequest &req)
 
void set_default_route (std::unique_ptr< BaseRequestHandler > cb)
 
void clear_default_route ()
 
void route (HttpRequest req)
 
void require_realm (const std::string &realm)
 

Private Attributes

std::vector< RouterDatarequest_handlers_
 
std::unique_ptr< BaseRequestHandlerdefault_route_
 
std::string require_realm_
 
std::mutex route_mtx_
 

Member Function Documentation

◆ append()

void HttpRequestRouter::append ( const std::string &  url_regex_str,
std::unique_ptr< BaseRequestHandler cb 
)

request router

send requests for a path of the URI to a handler callback

if no handler is found, reply with 404 not found

◆ clear_default_route()

void HttpRequestRouter::clear_default_route ( )

◆ remove()

void HttpRequestRouter::remove ( const std::string &  url_regex_str)

◆ require_realm()

void HttpRequestRouter::require_realm ( const std::string &  realm)
inline

◆ route()

void HttpRequestRouter::route ( HttpRequest  req)

◆ route_default()

void HttpRequestRouter::route_default ( HttpRequest req)

◆ set_default_route()

void HttpRequestRouter::set_default_route ( std::unique_ptr< BaseRequestHandler cb)

Member Data Documentation

◆ default_route_

std::unique_ptr<BaseRequestHandler> HttpRequestRouter::default_route_
private

◆ request_handlers_

std::vector<RouterData> HttpRequestRouter::request_handlers_
private

◆ require_realm_

std::string HttpRequestRouter::require_realm_
private

◆ route_mtx_

std::mutex HttpRequestRouter::route_mtx_
private

The documentation for this class was generated from the following files: