TrinityCore
Trinity::Net::Http::DispatcherService Class Reference

#include <HttpService.h>

+ Inheritance diagram for Trinity::Net::Http::DispatcherService:

Public Member Functions

 DispatcherService (std::string_view loggerSuffix)
 
RequestHandlerResult HandleRequest (std::shared_ptr< AbstractSocket > session, RequestContext &context)
 

Static Public Member Functions

static RequestHandlerResult HandleBadRequest (std::shared_ptr< AbstractSocket > session, RequestContext &context)
 
static RequestHandlerResult HandleUnauthorized (std::shared_ptr< AbstractSocket > session, RequestContext &context)
 
static RequestHandlerResult HandlePathNotFound (std::shared_ptr< AbstractSocket > session, RequestContext &context)
 

Protected Member Functions

void RegisterHandler (boost::beast::http::verb method, std::string_view path, std::function< RequestHandlerResult(std::shared_ptr< AbstractSocket > session, RequestContext &context)> handler, RequestHandlerFlag flags=RequestHandlerFlag::None)
 

Private Types

using HttpMethodHandlerMap = std::map< std::string, RequestHandler, std::less<> >
 

Private Attributes

HttpMethodHandlerMap _getHandlers
 
HttpMethodHandlerMap _postHandlers
 
std::string _logger
 

Detailed Description

Definition at line 54 of file HttpService.h.

Member Typedef Documentation

◆ HttpMethodHandlerMap

using Trinity::Net::Http::DispatcherService::HttpMethodHandlerMap = std::map<std::string, RequestHandler, std::less<> >
private

Definition at line 74 of file HttpService.h.

Constructor & Destructor Documentation

◆ DispatcherService()

Trinity::Net::Http::DispatcherService::DispatcherService ( std::string_view  loggerSuffix)
inlineexplicit

Definition at line 57 of file HttpService.h.

Member Function Documentation

◆ HandleBadRequest()

RequestHandlerResult Trinity::Net::Http::DispatcherService::HandleBadRequest ( std::shared_ptr< AbstractSocket session,
RequestContext context 
)
static

Definition at line 84 of file HttpService.cpp.

◆ HandlePathNotFound()

RequestHandlerResult Trinity::Net::Http::DispatcherService::HandlePathNotFound ( std::shared_ptr< AbstractSocket session,
RequestContext context 
)
static

Definition at line 96 of file HttpService.cpp.

◆ HandleRequest()

RequestHandlerResult Trinity::Net::Http::DispatcherService::HandleRequest ( std::shared_ptr< AbstractSocket session,
RequestContext context 
)

Definition at line 38 of file HttpService.cpp.

+ Here is the call graph for this function:

◆ HandleUnauthorized()

RequestHandlerResult Trinity::Net::Http::DispatcherService::HandleUnauthorized ( std::shared_ptr< AbstractSocket session,
RequestContext context 
)
static

Definition at line 90 of file HttpService.cpp.

+ Here is the caller graph for this function:

◆ RegisterHandler()

void Trinity::Net::Http::DispatcherService::RegisterHandler ( boost::beast::http::verb  method,
std::string_view  path,
std::function< RequestHandlerResult(std::shared_ptr< AbstractSocket > session, RequestContext &context)>  handler,
RequestHandlerFlag  flags = RequestHandlerFlag::None 
)
protected

Definition at line 102 of file HttpService.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _getHandlers

HttpMethodHandlerMap Trinity::Net::Http::DispatcherService::_getHandlers
private

Definition at line 76 of file HttpService.h.

◆ _logger

std::string Trinity::Net::Http::DispatcherService::_logger
private

Definition at line 79 of file HttpService.h.

◆ _postHandlers

HttpMethodHandlerMap Trinity::Net::Http::DispatcherService::_postHandlers
private

Definition at line 77 of file HttpService.h.


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