Seastar
High performance C++ framework for concurrent servers
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Member Functions | Protected Attributes | List of all members
seastar::httpd::api_registry_base Class Referenceabstract
Inheritance diagram for seastar::httpd::api_registry_base:
seastar::httpd::handler_base seastar::httpd::api_registry seastar::httpd::api_registry_20

Public Member Functions

 api_registry_base (routes &routes, const sstring &file_directory, const sstring &base_path)
 
void set_route (handler_base *h)
 
virtual future< std::unique_ptr< http::reply > > handle (const sstring &path, std::unique_ptr< http::request > req, std::unique_ptr< http::reply > rep)=0
 
handler_basemandatory (const sstring &param)
 
void verify_mandatory_params (const http::request &req) const
 

Protected Attributes

sstring _base_path
 
sstring _file_directory
 
routes_routes
 

Member Function Documentation

◆ handle()

virtual future< std::unique_ptr< http::reply > > seastar::httpd::handler_base::handle ( const sstring &  path,
std::unique_ptr< http::request req,
std::unique_ptr< http::reply rep 
)
pure virtualinherited

All handlers should implement this method. It fill the reply according to the request.

Parameters
paththe url path used in this call
reqthe original request
repthe reply

Implemented in seastar::httpd::api_registry, seastar::httpd::api_registry_20, seastar::httpd::directory_handler, seastar::httpd::file_handler, and seastar::httpd::function_handler.

◆ mandatory()

handler_base & seastar::httpd::handler_base::mandatory ( const sstring &  param)
inlineinherited

Add a mandatory parameter

Parameters
parama parameter name
Returns
a reference to the handler

◆ verify_mandatory_params()

void seastar::httpd::handler_base::verify_mandatory_params ( const http::request req) const
inlineinherited

Check if all mandatory parameters exist in the request. if any param does not exist, the function would throw a missing_param_exception

Parameters
paramsreq the http request

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