Malloy
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
malloy::server::endpoint_http_regex< Response, Handler, WantsCapture > Class Template Reference
Inheritance diagram for malloy::server::endpoint_http_regex< Response, Handler, WantsCapture >:
Inheritance graph
[legend]
Collaboration diagram for malloy::server::endpoint_http_regex< Response, Handler, WantsCapture >:
Collaboration graph
[legend]

Public Types

template<typename Derived >
using req_gen_t = std::shared_ptr< typename http::connection< Derived >::request_generator >
 
template<typename Req >
using handler_t = std::conditional_t< WantsCapture, std::function< Response(const Req &, const std::vector< std::string > &)>, std::function< Response(const Req &)> >
 
- Public Types inherited from malloy::server::endpoint_http
template<typename... Bodies>
using response_t = std::variant< malloy::http::response< Bodies >... >
 
template<typename... Bodies>
using writer_t = std::function< void(const boost::beast::http::request_header<> &, std::variant< malloy::http::response< Bodies >... > &&, const http::connection_t &)>
 
using handle_retr = std::optional< malloy::http::response< boost::beast::http::string_body > >
 
using req_header_t = boost::beast::http::request_header<>
 
using req_t = http::request_generator_t
 

Public Member Functions

bool matches_resource (const req_header_t &req) const override
 
bool matches (const req_header_t &req) const override
 
handle_retr handle (const req_t &gens, const http::connection_t &conn) const override
 
- Public Member Functions inherited from malloy::server::endpoint_http
 endpoint_http (const endpoint_http &other)=default
 
 endpoint_http (endpoint_http &&other) noexcept=default
 
endpoint_httpoperator= (const endpoint_http &rhs)=default
 
endpoint_httpoperator= (endpoint_http &&rhs) noexcept=default
 
virtual bool matches (const req_header_t &req) const
 
virtual handle_retr handle (const req_t &req, const http::connection_t &conn) const =0
 
- Public Member Functions inherited from malloy::server::endpoint
 endpoint (const endpoint &other)=default
 
 endpoint (endpoint &&other) noexcept=default
 
endpointoperator= (const endpoint &rhs)=default
 
endpointoperator= (endpoint &&rhs) noexcept=default
 
virtual bool matches_resource (const boost::beast::http::request_header<> &req) const =0
 

Public Attributes

Handler filter
 
std::regex resource_base
 
handler_t< typename Handler::request_type > handler
 
std::function< void(const boost::beast::http::request_header<> &, Response &&, const http::connection_t &)> writer
 
- Public Attributes inherited from malloy::server::endpoint_http
malloy::http::method method = malloy::http::method::unknown
 

Member Function Documentation

◆ handle()

template<typename Response , concepts::request_filter Handler, bool WantsCapture>
handle_retr malloy::server::endpoint_http_regex< Response, Handler, WantsCapture >::handle ( const req_t &  req,
const http::connection_t &  conn 
) const
inlineoverridevirtual

Handle the request and return the corresponding response.

Parameters
reqThe request.
Returns
The response for the specified request.

Implements malloy::server::endpoint_http.

Here is the call graph for this function:

◆ matches()

template<typename Response , concepts::request_filter Handler, bool WantsCapture>
bool malloy::server::endpoint_http_regex< Response, Handler, WantsCapture >::matches ( const req_header_t &  req) const
inlineoverridevirtual

Checks whether this endpoint would match the specified request.

The default implementation only checks for the matching method.

Parameters
reqThe request to check.
locationThe location to check for matching.
Returns
Whether this endpoint matches the request.

Reimplemented from malloy::server::endpoint_http.

Here is the call graph for this function:

◆ matches_resource()

template<typename Response , concepts::request_filter Handler, bool WantsCapture>
bool malloy::server::endpoint_http_regex< Response, Handler, WantsCapture >::matches_resource ( const req_header_t &  req) const
inlineoverridevirtual

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