Seastar
High performance C++ framework for concurrent servers
Public Member Functions | Public Attributes | Protected Attributes | List of all members
seastar::httpd::function_handler Class Reference

Detailed Description

The function handler get a lambda expression in the constructor. it will call that expression to get the result This is suited for very simple handlers

#include <seastar/http/function_handlers.hh>

Inheritance diagram for seastar::httpd::function_handler:
seastar::httpd::handler_base

Public Member Functions

 function_handler (const handle_function &f_handle, const sstring &type)
 
 function_handler (const future_handler_function &f_handle, const sstring &type)
 
 function_handler (const request_function &_handle, const sstring &type)
 
 function_handler (const json_request_function &_handle)
 
 function_handler (const future_json_function &_handle)
 
 function_handler (const function_handler &)=default
 
future< std::unique_ptr< http::reply > > handle (const sstring &path, std::unique_ptr< http::request > req, std::unique_ptr< http::reply > rep) override
 
handler_basemandatory (const sstring &param)
 

Public Attributes

std::vector< sstring > _mandatory_param
 

Protected Attributes

future_handler_function _f_handle
 
sstring _type
 

Member Function Documentation

◆ handle()

future<std::unique_ptr<http::reply> > seastar::httpd::function_handler::handle ( const sstring &  path,
std::unique_ptr< http::request req,
std::unique_ptr< http::reply rep 
)
inlineoverridevirtual

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

Implements seastar::httpd::handler_base.

◆ 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

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