RESTinio
Namespaces | Classes | Typedefs | Functions
restinio::router Namespace Reference

Namespaces

 easy_parser_router
 
 impl
 
 pcre2_details
 
 pcre_details
 

Classes

struct  boost_regex_engine_t
 Regex engine implementation for using with standard regex implementation. More...
 
class  dynamic_any_of_methods_matcher_t
 An implementation of method_matcher that allows a method if it's found in a dynamic list of allowed methods. More...
 
class  dynamic_none_of_methods_matcher_t
 An implementation of method_matcher that allows a method if it isn't found in a dynamic list of disabled methods. More...
 
class  easy_parser_router_t
 A request router that uses easy_parser for matching requests with handlers. More...
 
class  express_route_entry_t
 A single express route entry. More...
 
class  express_router_t
 Express.js style router. More...
 
struct  method_matcher_t
 An interface of method_matcher. More...
 
struct  pcre2_regex_engine_t
 Regex engine implementation for PCRE2. More...
 
struct  pcre2_traits_t
 PCRE traits. More...
 
struct  pcre_regex_engine_t
 Regex engine implementation for PCRE. More...
 
struct  pcre_traits_t
 PCRE traits. More...
 
class  route_params_t
 Parameters extracted from route. More...
 
struct  std_regex_engine_t
 Regex engine implementation for using with standard regex implementation. More...
 

Typedefs

using express_request_handler_t = std::function< request_handling_status_t(request_handle_t, route_params_t) >
 
using non_matched_request_handler_t = std::function< request_handling_status_t(request_handle_t) >
 

Functions

template<typename... Args>
RESTINIO_NODISCARD impl::fixed_size_any_of_matcher_t< sizeof...(Args) > any_of_methods (Args &&...args)
 A factory function that creates a method_matcher that allows a method if it's found in the list of allowed methods. More...
 
template<typename... Args>
RESTINIO_NODISCARD impl::fixed_size_none_of_matcher_t< sizeof...(Args) > none_of_methods (Args &&...args)
 A factory function that creates a method_matcher that allows a method if it isn't found in the list of disabled methods. More...
 

Typedef Documentation

◆ express_request_handler_t

Definition at line 423 of file express.hpp.

◆ non_matched_request_handler_t

Definition at line 28 of file non_matched_request_handler.hpp.

Function Documentation

◆ any_of_methods()

template<typename... Args>
RESTINIO_NODISCARD impl::fixed_size_any_of_matcher_t< sizeof...(Args) > restinio::router::any_of_methods ( Args &&...  args)

A factory function that creates a method_matcher that allows a method if it's found in the list of allowed methods.

Usage example:

router->add_handler(
restinio::http_method_get(), restinio::http_method_head()),
"/users/:id",
[](const auto & req, auto & params) {...});
Note
Returns the created object by value without any allocations.
Since
v.0.6.6

Definition at line 417 of file method_matcher.hpp.

◆ none_of_methods()

template<typename... Args>
RESTINIO_NODISCARD impl::fixed_size_none_of_matcher_t< sizeof...(Args) > restinio::router::none_of_methods ( Args &&...  args)

A factory function that creates a method_matcher that allows a method if it isn't found in the list of disabled methods.

Usage example:

router->add_handler(
restinio::http_method_get(), restinio::http_method_head()),
"/users/:id",
[](const auto & req, auto &) {
return req->create_response(status_method_not_allowed())
.connection_close().done();
});
Note
Returns the created object by value without any allocations.
Since
v.0.6.6
Examples
sample/express_router/main.cpp.

Definition at line 449 of file method_matcher.hpp.

restinio::status_method_not_allowed
http_status_line_t status_method_not_allowed()
Definition: http_headers.hpp:2232
restinio::router::any_of_methods
RESTINIO_NODISCARD impl::fixed_size_any_of_matcher_t< sizeof...(Args) > any_of_methods(Args &&...args)
A factory function that creates a method_matcher that allows a method if it's found in the list of al...
Definition: method_matcher.hpp:417
restinio::router::none_of_methods
RESTINIO_NODISCARD impl::fixed_size_none_of_matcher_t< sizeof...(Args) > none_of_methods(Args &&...args)
A factory function that creates a method_matcher that allows a method if it isn't found in the list o...
Definition: method_matcher.hpp:449
restinio::response_connection_attr_t::connection_keepalive
@ connection_keepalive
This response says to keep connection.