RESTinio
|
Namespaces | |
asio_ec | |
connection_state | |
details | |
impl | |
ip_blocker | |
parse_query_traits | |
path2regex | |
router | |
so5 | |
status_code | |
transforms | |
utils | |
websocket | |
Classes | |
class | acceptor_options_t |
An adapter for setting acceptor options before running server. More... | |
class | asio_timer_manager_t |
Timer factory implementation using asio timers. More... | |
class | base_response_builder_t |
class | basic_server_settings_t |
Basic container for http_server settings. More... | |
struct | chunked_output_t |
Tag type for chunked output response builder. More... | |
struct | connection_state_listener_holder_t |
A special class for holding actual connection state listener. More... | |
struct | connection_state_listener_holder_t< connection_state::noop_listener_t > |
A special class for case when no-op state listener is used. More... | |
struct | const_buffer_t |
Helper class for setting a constant buffer storage explicitly. More... | |
class | default_http_methods_t |
The default implementation for http_method_mapper. More... | |
class | exception_t |
Exception class for all exceptions thrown by RESTinio. More... | |
class | file_descriptor_holder_t |
Wrapper class for working with native file handler. More... | |
class | file_meta_t |
Meta data of the file. More... | |
struct | http_header_common_t |
Req/Resp headers common data. More... | |
class | http_header_field_t |
A single header field. More... | |
class | http_header_fields_t |
Header fields map. More... | |
class | http_method_id_t |
A type for representation of HTTP method ID. More... | |
struct | http_request_header_t |
Req header. More... | |
struct | http_response_header_t |
Resp header. More... | |
class | http_server_t |
Class for http-server. More... | |
class | http_status_code_t |
A handy wrapper for HTTP response status code. More... | |
class | http_status_line_t |
HTTP response header status line. More... | |
class | io_context_holder_t |
Helper class for holding shared pointer to io_context. More... | |
struct | ip_blocker_holder_t |
A special class for holding actual IP-blocker object. More... | |
struct | ip_blocker_holder_t< ip_blocker::noop_ip_blocker_t > |
A special class for case when no-op IP-blocker is used. More... | |
struct | null_lock_t |
Fake lock. More... | |
class | null_logger_t |
No operation logger. More... | |
struct | null_timer_manager_t |
Timer factory implementation using asio timers. More... | |
class | on_pool_runner_t |
Helper class for running an existing HTTP-server on a thread pool without blocking the current thread. More... | |
class | ostream_logger_t |
Logger for std::ostream. More... | |
class | query_string_params_t |
Parameters container for query strings parameters. More... | |
class | request_t |
HTTP Request data. More... | |
class | response_builder_t |
Forbid arbitrary response_builder_t instantiations. More... | |
class | response_builder_t< chunked_output_t > |
Chunked transfer encoding output builder. More... | |
class | response_builder_t< restinio_controlled_output_t > |
Simple standard response builder. More... | |
class | response_builder_t< user_controlled_output_t > |
User controlled response output builder. More... | |
struct | response_output_flags_t |
Response output flags for buffers commited to response-coordinator. More... | |
struct | restinio_controlled_output_t |
Tag type for RESTinio controlled output response builder. More... | |
class | run_existing_server_on_thread_pool_t |
Helper type for holding parameters necessary for running HTTP-server on a thread pool. More... | |
class | run_on_this_thread_settings_t |
Settings for the case when http_server must be run on the context of the current thread. More... | |
class | run_on_thread_pool_settings_t |
Settings for the case when http_server must be run on the context of the current thread. More... | |
class | sendfile_chunk_size_guarded_value_t |
A guard class for setting chunk size. More... | |
class | sendfile_t |
Send file write operation description. More... | |
class | server_settings_t |
A fluent style interface for setting http server params. More... | |
class | socket_options_t |
An adapter for setting acceptor options before running server. More... | |
class | socket_type_dependent_settings_t |
Extra settings needed for working with socket. More... | |
class | socket_type_dependent_settings_t< Settings, tls_socket_t > |
Customizes extra settings needed for working with socket. More... | |
class | tcp_connection_ctx_base_t |
TCP connection base. More... | |
struct | traits_t |
struct | user_controlled_output_t |
Tag type for user controlled output response builder. More... | |
class | writable_item_t |
Class for storing the buffers used for streaming body (request/response). More... | |
class | write_group_t |
Group of writable items transported to the context of underlying connection as one solid piece. More... | |
Typedefs | |
using | error_category_base_t = asio_ns::error_category |
An alias for base class of error category entity. More... | |
using | writable_items_container_t = std::vector< writable_item_t > |
using | write_status_cb_t = std::function< void(const asio_ns::error_code &ec) > |
An alias for a callback to be invoked after the write operation of a particular group of "buffers". More... | |
using | request_id_t = unsigned int |
Request id in scope of single connection. More... | |
template<typename T > | |
using | nullable_pointer_t = T * |
Type for pointer that can be nullptr. More... | |
template<typename T > | |
using | not_null_pointer_t = T * |
Type for pointer that is not null by design. More... | |
using | connection_id_t = std::uint64_t |
Type for ID of connection. More... | |
using | endpoint_t = asio_ns::ip::tcp::endpoint |
An alias for endpoint type from Asio. More... | |
using | http_field = http_field_t |
Helper alies to omitt _t suffix. More... | |
using | io_context_shared_ptr_t = std::shared_ptr< asio_ns::io_context > |
template<class T > | |
using | optional_t = nonstd::optional< T > |
using | single_threaded_ostream_logger_t = ostream_logger_t< null_lock_t > |
using | shared_ostream_logger_t = ostream_logger_t< std::mutex > |
using | request_handle_t = std::shared_ptr< request_t > |
Request handler, that is the type for calling request handlers. More... | |
using | default_request_handler_t = std::function< request_handling_status_t(request_handle_t) > |
using | acceptor_options_setter_t = std::function< void(acceptor_options_t &) > |
using | socket_options_setter_t = std::function< void(socket_options_t &) > |
using | cleanup_functor_t = std::function< void(void) > |
Type of holder for user's cleanup function. More... | |
using | string_view_t = nonstd::string_view |
using | tcp_connection_ctx_handle_t = std::shared_ptr< tcp_connection_ctx_base_t > |
Alias for http connection handle. More... | |
using | tcp_connection_ctx_weak_handle_t = std::weak_ptr< tcp_connection_ctx_base_t > |
Alias for http connection weak handle. More... | |
using | timer_invocation_tag_t = std::uint32_t |
An invokation tag, for controlling no more actual timers in corner cases. More... | |
using | timer_invocation_cb_t = std::add_pointer< void(timer_invocation_tag_t, tcp_connection_ctx_weak_handle_t) >::type |
A pointer to invocation callback for a specific context object. More... | |
using | tls_socket_t = impl::tls_socket_t |
template<typename Timer_Factory , typename Logger , typename Request_Handler = default_request_handler_t, typename Strand = asio_ns::strand< asio_ns::executor >> | |
using | tls_traits_t = traits_t< Timer_Factory, Logger, Request_Handler, Strand, tls_socket_t > |
template<typename Timer_Factory , typename Logger , typename Request_Handler = default_request_handler_t> | |
using | single_thread_tls_traits_t = tls_traits_t< Timer_Factory, Logger, Request_Handler, noop_strand_t > |
using | default_tls_traits_t = tls_traits_t< asio_timer_manager_t, null_logger_t > |
using | noop_strand_t = asio_ns::executor |
template<typename Timer_Manager , typename Logger , typename Request_Handler = default_request_handler_t> | |
using | single_thread_traits_t = traits_t< Timer_Manager, Logger, Request_Handler, noop_strand_t > |
using | default_traits_t = traits_t< asio_timer_manager_t, null_logger_t > |
using | default_single_thread_traits_t = single_thread_traits_t< asio_timer_manager_t, null_logger_t > |
Default traits for single-threaded HTTP-server. More... | |
template<typename... Types> | |
using | variant_t = nonstd::variant< Types... > |
Aliases for sendfile operation. | |
using | file_descriptor_t = std::FILE * |
using | file_offset_t = std::int64_t |
using | file_size_t = std::uint64_t |
Functions | |
const error_category_base_t & | restinio_err_category () |
Get restinio error category. More... | |
asio_ns::error_code | make_asio_compaible_error (asio_convertible_error_t err) noexcept |
Make restinio error_code compatible with asio_ns::error_code. More... | |
template<typename Value_Type > | |
Value_Type | cast_to (string_view_t str_representation) |
Cast string representation to a given type. More... | |
std::ostream & | operator<< (std::ostream &o, response_parts_attr_t attr) |
std::ostream & | operator<< (std::ostream &o, response_connection_attr_t attr) |
response_connection_attr_t | response_connection_attr (bool should_keep_alive) |
std::ostream & | operator<< (std::ostream &o, const response_output_flags_t &flags) |
bool | caseless_cmp (const char *a, const char *b, std::size_t size) noexcept |
Comparator for fields names. More... | |
bool | caseless_cmp (const char *a, std::size_t a_size, const char *b, std::size_t b_size) noexcept |
Comparator for fields names. More... | |
bool | caseless_cmp (string_view_t a, string_view_t b) noexcept |
Comparator for fields names. More... | |
io_context_holder_t | own_io_context () |
Function which tells that http_server should create and use its own instance of io_context. More... | |
io_context_holder_t | external_io_context (asio_ns::io_context &ctx) |
Function which tells that http_server should use external instance of io_context and should not controll its lifetime. More... | |
constexpr break_signal_handling_t | use_break_signal_handling () noexcept |
Make the indicator for usage of break signal handler. More... | |
constexpr break_signal_handling_t | skip_break_signal_handling () noexcept |
Make the indicator for absence of break signal handler. More... | |
template<typename Traits = default_single_thread_traits_t> | |
run_on_this_thread_settings_t< Traits > | on_this_thread () |
A special marker for the case when http_server must be run on the context of the current thread. More... | |
template<typename Traits = default_traits_t> | |
run_on_thread_pool_settings_t< Traits > | on_thread_pool (std::size_t pool_size) |
A special marker for the case when http_server must be run on an thread pool. More... | |
template<typename Traits > | |
void | run (asio_ns::io_context &ioctx, run_on_this_thread_settings_t< Traits > &&settings) |
Helper function for running http server until ctrl+c is hit. More... | |
template<typename Traits > | |
void | run (run_on_this_thread_settings_t< Traits > &&settings) |
Helper function for running http server until ctrl+c is hit. More... | |
template<typename Traits > | |
void | run (run_on_thread_pool_settings_t< Traits > &&settings) |
Helper function for running http server until ctrl+c is hit. More... | |
template<typename Traits > | |
void | run (asio_ns::io_context &ioctx, run_on_thread_pool_settings_t< Traits > &&settings) |
Helper function for running http server until ctrl+c is hit. More... | |
template<typename Traits > | |
run_existing_server_on_thread_pool_t< Traits > | on_thread_pool (std::size_t pool_size, break_signal_handling_t break_handling, http_server_t< Traits > &server) |
Helper function for running an existing HTTP-server on a thread pool. More... | |
template<typename Traits > | |
void | run (run_existing_server_on_thread_pool_t< Traits > &¶ms) |
Helper function for running an existing HTTP-server on a thread pool. More... | |
template<typename Traits > | |
void | initiate_shutdown (http_server_t< Traits > &server) |
Helper function for initiation of server shutdown. More... | |
std::string | make_date_field_value (std::time_t t) |
Format a timepoint to a string of a propper format. More... | |
std::string | make_date_field_value (std::chrono::system_clock::time_point tp) |
std::tm | make_gmtime (std::time_t t) |
std::tm | make_localtime (std::time_t t) |
std::ostream & | operator<< (std::ostream &o, const request_t &req) |
template<typename Value_Type > | |
Value_Type | get (const router::route_params_t ¶ms, string_view_t key) |
Cast named parameter value to a given type. More... | |
template<typename Value_Type > | |
Value_Type | get (const router::route_params_t ¶ms, std::size_t index) |
Cast indexed parameter value to a given type. More... | |
template<typename Object > | |
auto | create_default_unique_object_instance () |
Default instantiation for a specific type. More... | |
template<> | |
auto | create_default_unique_object_instance< default_request_handler_t > () |
Default instantiation for default_request_handler_t. More... | |
template<typename Object > | |
auto | create_default_shared_object_instance () |
Default instantiation for a specific type. More... | |
template<> | |
auto | create_default_shared_object_instance< default_request_handler_t > () |
Default instantiation for default_request_handler_t. More... | |
template<typename Object > | |
auto | ensure_created (std::unique_ptr< Object > mb_created_one, string_view_t fail_description) |
Ensure that object was created. More... | |
template<typename Object > | |
auto | ensure_created (std::shared_ptr< Object > mb_created_one, string_view_t fail_description) |
Ensure that object was created. More... | |
template<> | |
auto | create_default_unique_object_instance< acceptor_options_setter_t > () |
template<> | |
auto | create_default_unique_object_instance< socket_options_setter_t > () |
template<typename Traits , typename Configurator > | |
auto | exec_configurator (Configurator &&configurator) |
template<typename Connection , typename Start_Read_CB , typename Failed_CB > | |
void | prepare_connection_and_start_read (tls_socket_t &socket, Connection &con, Start_Read_CB start_read_cb, Failed_CB failed_cb) |
Customizes connection init routine with an additional step: perform handshake and only then start reading. More... | |
template<typename Value_Type > | |
Value_Type | get (const query_string_params_t ¶ms, string_view_t key) |
Cast query string parameter to a given type. More... | |
template<typename Parse_Traits = parse_query_traits::restinio_defaults> | |
query_string_params_t | parse_query (string_view_t original_query_string) |
Parse query key-value parts. More... | |
template<typename Value_Type , typename Parameter_Container > | |
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, Value_Type >::type | value_or (const Parameter_Container ¶ms, string_view_t key, Value_Type default_value) |
Get parameter value or a given default. More... | |
template<typename Value_Type , typename Parameter_Container > | |
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, optional_t< Value_Type > >::type | opt_value (const Parameter_Container ¶ms, string_view_t key) |
Gets the value of a parameter specified by key wrapped in optional_t<Value_Type> if parameter exists and empty optional_t<Value_Type> if parameter with a given key value doesn't exist. More... | |
Adoptation functions to cover differences between snad-alone and beast asio. | |
bool | error_is_operation_aborted (const asio_ns::error_code &ec) |
bool | error_is_eof (const asio_ns::error_code &ec) |
Create const buffers. | |
constexpr const_buffer_t | const_buffer (const void *str, std::size_t size) noexcept |
const_buffer_t | const_buffer (const char *str) noexcept |
Helper funcs for working with request_handling_status_t | |
| |
constexpr request_handling_status_t | request_accepted () noexcept |
constexpr request_handling_status_t | request_rejected () noexcept |
RFC 2616 statuses. | |
Codes defined by RFC 2616: https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1.1. | |
http_status_line_t | status_continue () |
http_status_line_t | status_switching_protocols () |
http_status_line_t | status_ok () |
http_status_line_t | status_created () |
http_status_line_t | status_accepted () |
http_status_line_t | status_non_authoritative_information () |
http_status_line_t | status_no_content () |
http_status_line_t | status_reset_content () |
http_status_line_t | status_partial_content () |
http_status_line_t | status_multiple_choices () |
http_status_line_t | status_moved_permanently () |
http_status_line_t | status_found () |
http_status_line_t | status_see_other () |
http_status_line_t | status_not_modified () |
http_status_line_t | status_use_proxy () |
http_status_line_t | status_temporary_redirect () |
http_status_line_t | status_bad_request () |
http_status_line_t | status_unauthorized () |
http_status_line_t | status_payment_required () |
http_status_line_t | status_forbidden () |
http_status_line_t | status_not_found () |
http_status_line_t | status_method_not_allowed () |
http_status_line_t | status_not_acceptable () |
http_status_line_t | status_proxy_authentication_required () |
http_status_line_t | status_request_time_out () |
http_status_line_t | status_conflict () |
http_status_line_t | status_gone () |
http_status_line_t | status_length_required () |
http_status_line_t | status_precondition_failed () |
http_status_line_t | status_payload_too_large () |
http_status_line_t | status_uri_too_long () |
http_status_line_t | status_unsupported_media_type () |
http_status_line_t | status_requested_range_not_satisfiable () |
http_status_line_t | status_expectation_failed () |
http_status_line_t | status_internal_server_error () |
http_status_line_t | status_not_implemented () |
http_status_line_t | status_bad_gateway () |
http_status_line_t | status_service_unavailable () |
http_status_line_t | status_gateway_time_out () |
http_status_line_t | status_http_version_not_supported () |
Additional statuses. | |
Not covered with RFC 2616. | |
http_status_line_t | status_permanent_redirect () |
http_status_line_t | status_processing () |
http_status_line_t | status_multi_status () |
http_status_line_t | status_unprocessable_entity () |
http_status_line_t | status_locked () |
http_status_line_t | status_failed_dependency () |
http_status_line_t | status_insufficient_storage () |
http_status_line_t | status_precondition_required () |
http_status_line_t | status_too_many_requests () |
http_status_line_t | status_request_header_fields_too_large () |
http_status_line_t | status_network_authentication_required () |
Functions for creating sendfile_t objects. | |
A group of function to create sendfile_t, that is convertad to writable items used as a part of response.
| |
sendfile_t | sendfile (file_descriptor_holder_t fd, file_meta_t meta, file_size_t chunk_size=sendfile_default_chunk_size) noexcept |
sendfile_t | sendfile (const char *file_path, file_size_t chunk_size=sendfile_default_chunk_size) |
sendfile_t | sendfile (const std::string &file_path, file_size_t chunk_size=sendfile_default_chunk_size) |
sendfile_t | sendfile (string_view_t file_path, file_size_t chunk_size=sendfile_default_chunk_size) |
File operations. | |
A minimal set of file operations. Incapsulates details of native API for a set of file operations neccessary for sendfile_t class implementation. | |
constexpr file_descriptor_t | null_file_descriptor () |
Get file descriptor which stands for null. More... | |
file_descriptor_t | open_file (const char *file_path) |
Open file. More... | |
template<typename META > | |
META | get_file_meta (file_descriptor_t fd) |
Get file size. More... | |
void | close_file (file_descriptor_t fd) |
Close file by its descriptor. More... | |
Variables | |
constexpr file_size_t | sendfile_default_chunk_size = 1024 * 1024 |
Default chunk size for sendfile operation. More... | |
constexpr file_size_t | sendfile_max_chunk_size = 1024 * 1024 * 1024 |
Maximum size of a chunk. More... | |
enum | http_connection_header_t : std::uint8_t { http_connection_header_t::keep_alive, http_connection_header_t::close, http_connection_header_t::upgrade } |
Values for conection header field. More... | |
http_field_t | string_to_field (string_view_t field) noexcept |
Helper function to get method string name. More... | |
const char * | field_to_string (http_field_t f) noexcept |
Helper sunction to get method string name. More... | |
std::ostream & | operator<< (std::ostream &to, const http_method_id_t &m) |
constexpr http_method_id_t | http_method_unknown () |
std::ostream & | operator<< (std::ostream &o, const http_status_line_t &status_line) |
sendfile routine.
Selective include of asio/boost::asio.
Timer factory implementation using asio timers.
Restinio buffers.
Cast.
Restinio common types.
Exception class for all exceptions thrown by RESTinio.
helpers for http communication.
HTTP-Server.
HTTP-Acceptor handler routine.
HTTP-connection routine.
A base class for connection handle.
Connection settings.
Execution mixin.
Fixed size buffer.
HTTP-Connection handler routine.
Coordinator for process od sending responses with respect to http pipeline technique and chunk transfer.
Socket adapter for asio::ssl::stream< asio::ip::tcp::socket >.
Helper output context for writing buffers to output stream (socket).
Builders for messages.
Ready to use loggers implementations.
No-op timer factory implementation.
Adoption for std::optional (c++17).
OS specific functions.
Ready to use logger implementation for using with std::ostream.
Utility for converting express.js style routes to regexp.
Code adopted from https://github.com/pillarjs/path-to-regexp.
HTTP-request handlers routine.
Regex engine for using std::regex.
Express.js style router.
Sendfile routine.
Sendfile routine definitions (default implementation via <cstdio>).
Sendfile routine definitions (posix implementation).
HTTP-Server configuration.
Timers implementation with sobjectizer timers.
Adoption for std::string_view (c++17).
A base class for all classes that deal with connection context.
Support for https.
HTTP server traits.
Transformator of data streams using zlib.
escape functions.
Base64 implementation.
Convert strings to numeric types.
Helpers for extraction group of bits from numbers.
Percent encoding routine.
SHA1 implementation.
Helper functions for parameter extraction with default values.
Adoption for std::variant (c++17).
UTF-8 .
WebSocket connection routine.
Websocket.
Protocol header validator .
WebSocket messgage handler definition.
using restinio::acceptor_options_setter_t = typedef std::function< void ( acceptor_options_t & ) > |
Definition at line 222 of file settings.hpp.
using restinio::cleanup_functor_t = typedef std::function< void(void) > |
Type of holder for user's cleanup function.
Definition at line 304 of file settings.hpp.
using restinio::connection_id_t = typedef std::uint64_t |
Type for ID of connection.
Definition at line 155 of file common_types.hpp.
using restinio::default_request_handler_t = typedef std::function< request_handling_status_t ( request_handle_t ) > |
Definition at line 138 of file request_handler.hpp.
using restinio::default_single_thread_traits_t = typedef single_thread_traits_t< asio_timer_manager_t, null_logger_t > |
Default traits for single-threaded HTTP-server.
Uses default timer manager. And null logger.
Usage example:
Definition at line 176 of file traits.hpp.
using restinio::default_tls_traits_t = typedef tls_traits_t< asio_timer_manager_t, null_logger_t > |
using restinio::default_traits_t = typedef traits_t< asio_timer_manager_t, null_logger_t > |
Definition at line 157 of file traits.hpp.
using restinio::endpoint_t = typedef asio_ns::ip::tcp::endpoint |
An alias for endpoint type from Asio.
Definition at line 158 of file common_types.hpp.
using restinio::error_category_base_t = typedef asio_ns::error_category |
An alias for base class of error category entity.
Definition at line 41 of file asio_include.hpp.
typedef int restinio::file_descriptor_t |
Definition at line 21 of file sendfile_defs_default.hpp.
typedef std::int64_t restinio::file_offset_t |
Definition at line 22 of file sendfile_defs_default.hpp.
typedef std::uint64_t restinio::file_size_t |
Definition at line 23 of file sendfile_defs_default.hpp.
using restinio::http_field = typedef http_field_t |
Helper alies to omitt _t
suffix.
Definition at line 304 of file http_headers.hpp.
using restinio::io_context_shared_ptr_t = typedef std::shared_ptr< asio_ns::io_context > |
Definition at line 25 of file http_server.hpp.
using restinio::noop_strand_t = typedef asio_ns::executor |
Definition at line 140 of file traits.hpp.
using restinio::not_null_pointer_t = typedef T* |
Type for pointer that is not null by design.
Definition at line 150 of file common_types.hpp.
using restinio::nullable_pointer_t = typedef T* |
Type for pointer that can be nullptr.
This type is used in methods which return raw pointers. It indicates that returned value should be checked for nullptr.
Definition at line 135 of file common_types.hpp.
using restinio::optional_t = typedef nonstd::optional< T > |
Definition at line 18 of file optional.hpp.
using restinio::request_handle_t = typedef std::shared_ptr< request_t > |
Request handler, that is the type for calling request handlers.
Definition at line 131 of file request_handler.hpp.
using restinio::request_id_t = typedef unsigned int |
Request id in scope of single connection.
Definition at line 51 of file common_types.hpp.
using restinio::shared_ostream_logger_t = typedef ostream_logger_t< std::mutex > |
Definition at line 116 of file ostream_logger.hpp.
using restinio::single_thread_tls_traits_t = typedef tls_traits_t< Timer_Factory, Logger, Request_Handler, noop_strand_t > |
using restinio::single_thread_traits_t = typedef traits_t< Timer_Manager, Logger, Request_Handler, noop_strand_t > |
Definition at line 151 of file traits.hpp.
using restinio::single_threaded_ostream_logger_t = typedef ostream_logger_t< null_lock_t > |
using restinio::socket_options_setter_t = typedef std::function< void ( socket_options_t & ) > |
Definition at line 289 of file settings.hpp.
using restinio::string_view_t = typedef nonstd::string_view |
Definition at line 17 of file string_view.hpp.
using restinio::tcp_connection_ctx_handle_t = typedef std::shared_ptr< tcp_connection_ctx_base_t > |
Alias for http connection handle.
Definition at line 62 of file tcp_connection_ctx_base.hpp.
typedef std::weak_ptr< tcp_connection_ctx_base_t > restinio::tcp_connection_ctx_weak_handle_t |
Alias for http connection weak handle.
Definition at line 65 of file tcp_connection_ctx_base.hpp.
using restinio::timer_invocation_cb_t = typedef std::add_pointer< void ( timer_invocation_tag_t , tcp_connection_ctx_weak_handle_t ) >::type |
A pointer to invocation callback for a specific context object.
Definition at line 25 of file timer_common.hpp.
using restinio::timer_invocation_tag_t = typedef std::uint32_t |
An invokation tag, for controlling no more actual timers in corner cases.
Definition at line 20 of file timer_common.hpp.
using restinio::tls_socket_t = typedef impl::tls_socket_t |
using restinio::tls_traits_t = typedef traits_t< Timer_Factory, Logger, Request_Handler, Strand, tls_socket_t > |
using restinio::variant_t = typedef nonstd::variant< Types... > |
Definition at line 18 of file variant.hpp.
using restinio::writable_items_container_t = typedef std::vector< writable_item_t > |
Definition at line 638 of file buffers.hpp.
using restinio::write_status_cb_t = typedef std::function< void( const asio_ns::error_code & ec ) > |
An alias for a callback to be invoked after the write operation of a particular group of "buffers".
Definition at line 650 of file buffers.hpp.
|
strong |
Enum for restinio errors that must presented as asio_ns::error_code value.
Enumerator | |
---|---|
write_was_not_executed | After write notificator error: data was not sent, connection closed (or aborted) before a given piece of data. |
write_group_destroyed_passively | After write notificator error: a notificator was set for a write_group_t but no external invokation happened, so write_group_t destructor. |
Definition at line 111 of file asio_include.hpp.
|
strong |
Indication of usage of break signal handlers for some forms of run functions.
Enumerator | |
---|---|
used | Signal handler should be used by run() function. |
skipped | Signal handler should not be used by run() function. |
Definition at line 28 of file http_server_run.hpp.
|
strong |
Values for conection header field.
Enumerator | |
---|---|
keep_alive | |
close | |
upgrade |
Definition at line 1360 of file http_headers.hpp.
|
strong |
C++ enum that repeats nodejs c-style enum.
Connection
and Content-Length
are specieal cases, thus they are not present in the list. Enumerator | |
---|---|
RESTINIO_HTTP_FIELD_GEN | |
field_unspecified |
Definition at line 294 of file http_headers.hpp.
|
strong |
Request handling status.
If handler handles request it must return accepted.
If handler refuses to handle request it must return rejected.
Enumerator | |
---|---|
accepted | Request accepted for handling. |
rejected | Request wasn't accepted for handling. |
Definition at line 25 of file common_types.hpp.
|
strong |
Attribute for parts.
Enumerator | |
---|---|
connection_keepalive | This response says to keep connection. |
connection_close | This response says to close connection. |
Definition at line 74 of file common_types.hpp.
|
strong |
Attribute for parts.
Enumerator | |
---|---|
not_final_parts | Intermediate parts (more parts of response to follow). |
final_parts | Final parts (response ands with these parts). |
Definition at line 54 of file common_types.hpp.
|
strong |
Buffers write operation type.
Enumerator | |
---|---|
trivial_write_operation | Item is a buffer and must be written trivially. |
file_write_operation | Item is a sendfile operation and implicates file write operation. |
Definition at line 411 of file buffers.hpp.
Comparator for fields names.
Definition at line 48 of file http_headers.hpp.
|
inlinenoexcept |
Comparator for fields names.
Definition at line 68 of file http_headers.hpp.
|
inlinenoexcept |
Comparator for fields names.
Definition at line 88 of file http_headers.hpp.
Value_Type restinio::cast_to | ( | string_view_t | str_representation | ) |
Cast string representation to a given type.
Definition at line 27 of file cast_to.hpp.
|
inline |
Close file by its descriptor.
Definition at line 89 of file sendfile_defs_default.hpp.
|
inlinenoexcept |
Definition at line 394 of file buffers.hpp.
|
inlinenoexcept |
Definition at line 400 of file buffers.hpp.
|
inline |
Default instantiation for a specific type.
Definition at line 88 of file settings.hpp.
|
inline |
Default instantiation for default_request_handler_t.
Definition at line 97 of file settings.hpp.
|
inline |
Default instantiation for a specific type.
Definition at line 66 of file settings.hpp.
|
inline |
Definition at line 226 of file settings.hpp.
|
inline |
Default instantiation for default_request_handler_t.
Definition at line 75 of file settings.hpp.
|
inline |
Definition at line 293 of file settings.hpp.
auto restinio::ensure_created | ( | std::unique_ptr< Object > | mb_created_one, |
string_view_t | fail_description | ||
) |
Ensure that object was created.
Definition at line 110 of file settings.hpp.
auto restinio::ensure_created | ( | std::shared_ptr< Object > | mb_created_one, |
string_view_t | fail_description | ||
) |
Ensure that object was created.
Definition at line 130 of file settings.hpp.
|
inline |
Definition at line 27 of file asio_include.hpp.
|
inline |
Definition at line 22 of file asio_include.hpp.
auto restinio::exec_configurator | ( | Configurator && | configurator | ) |
Definition at line 1215 of file settings.hpp.
|
inline |
Function which tells that http_server should use external instance of io_context and should not controll its lifetime.
Usage example:
Definition at line 87 of file http_server.hpp.
|
inlinenoexcept |
Helper sunction to get method string name.
Definition at line 615 of file http_headers.hpp.
Value_Type restinio::get | ( | const query_string_params_t & | params, |
string_view_t | key | ||
) |
Cast query string parameter to a given type.
Definition at line 175 of file uri_helpers.hpp.
Value_Type restinio::get | ( | const router::route_params_t & | params, |
string_view_t | key | ||
) |
Cast named parameter value to a given type.
Definition at line 714 of file express.hpp.
Value_Type restinio::get | ( | const router::route_params_t & | params, |
std::size_t | index | ||
) |
Cast indexed parameter value to a given type.
Definition at line 722 of file express.hpp.
META restinio::get_file_meta | ( | file_descriptor_t | fd | ) |
|
inline |
Definition at line 1602 of file http_headers.hpp.
|
inline |
Helper function for initiation of server shutdown.
Can be useful if an existing HTTP-server is run via run() function. For example:
Definition at line 635 of file http_server_run.hpp.
|
inlinenoexcept |
Make restinio error_code compatible with asio_ns::error_code.
Definition at line 178 of file asio_include.hpp.
|
inline |
Format a timepoint to a string of a propper format.
Definition at line 34 of file message_builders.hpp.
|
inline |
Definition at line 50 of file message_builders.hpp.
constexpr file_descriptor_t restinio::null_file_descriptor | ( | ) |
Get file descriptor which stands for null.
Definition at line 36 of file sendfile_defs_default.hpp.
run_on_this_thread_settings_t<Traits> restinio::on_this_thread | ( | ) |
A special marker for the case when http_server must be run on the context of the current thread.
Usage example:
For a case when some custom traits must be used:
Definition at line 123 of file http_server_run.hpp.
run_on_thread_pool_settings_t<Traits> restinio::on_thread_pool | ( | std::size_t | pool_size | ) |
A special marker for the case when http_server must be run on an thread pool.
Usage example:
For a case when some custom traits must be used:
pool_size | Size of the pool. |
Definition at line 183 of file http_server_run.hpp.
run_existing_server_on_thread_pool_t<Traits> restinio::on_thread_pool | ( | std::size_t | pool_size, |
break_signal_handling_t | break_handling, | ||
http_server_t< Traits > & | server | ||
) |
Helper function for running an existing HTTP-server on a thread pool.
Usage example:
Definition at line 470 of file http_server_run.hpp.
|
inline |
Open file.
Definition at line 40 of file sendfile_defs_default.hpp.
|
inline |
Definition at line 63 of file common_types.hpp.
|
inline |
Definition at line 83 of file common_types.hpp.
|
inline |
Definition at line 117 of file common_types.hpp.
Definition at line 120 of file request_handler.hpp.
|
inline |
Definition at line 1587 of file http_headers.hpp.
|
inline |
Definition at line 1952 of file http_headers.hpp.
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value || std::is_same< Parameter_Container, router::route_params_t >::value, optional_t< Value_Type > >::type restinio::opt_value | ( | const Parameter_Container & | params, |
string_view_t | key | ||
) |
Gets the value of a parameter specified by key wrapped in optional_t<Value_Type>
if parameter exists and empty optional_t<Value_Type>
if parameter with a given key value doesn't exist.
If parameter exists in params it is obtained as string_view_t
object and casted to a necessary type and then is wrapped in optional_t<Value_Type>
. If params has no such parameters then the empty optional_t<Value_Type>
is returned.
Definition at line 64 of file value_or.hpp.
|
inline |
Function which tells that http_server should create and use its own instance of io_context.
Usage example:
Definition at line 65 of file http_server.hpp.
|
inline |
Parse query key-value parts.
Since v.0.4.9 this function correctly handles the following cases:
http://example.com/resource?tag
. In that case value of the tag (web beacon) can be obtained via query_string_params_t::tag() method. References: web beacon and query-string-tracking;;
instead of &
as parameter separator.Since v.0.4.9.1 this function can be parametrized by parser traits. For example:
original_query_string | Query part of the request target. |
Definition at line 237 of file uri_helpers.hpp.
void restinio::prepare_connection_and_start_read | ( | tls_socket_t & | socket, |
Connection & | con, | ||
Start_Read_CB | start_read_cb, | ||
Failed_CB | failed_cb | ||
) |
|
noexcept |
Definition at line 38 of file common_types.hpp.
|
noexcept |
Definition at line 44 of file common_types.hpp.
|
inline |
Definition at line 94 of file common_types.hpp.
|
inline |
Get restinio error category.
Definition at line 167 of file asio_include.hpp.
|
inline |
Helper function for running http server until ctrl+c is hit.
Can be useful when RESTinio server should be run on the user's own io_context instance.
For example:
ioctx | Asio's io_context to be used. Note: this reference should remain valid until RESTinio server finished. |
settings | Settings for that server instance. |
Definition at line 216 of file http_server_run.hpp.
|
inline |
Helper function for running http server until ctrl+c is hit.
This function creates its own instance of Asio's io_context and uses it exclusively.
Usage example:
Definition at line 271 of file http_server_run.hpp.
|
inline |
Helper function for running http server until ctrl+c is hit.
This function creates its own instance of Asio's io_context and uses it exclusively.
Usage example:
Definition at line 346 of file http_server_run.hpp.
|
inline |
Helper function for running http server until ctrl+c is hit.
Can be useful when RESTinio server should be run on the user's own io_context instance.
For example:
ioctx | Asio's io_context to be used. Note: this reference should remain valid until RESTinio server finished. |
settings | Settings for that server instance. |
Definition at line 377 of file http_server_run.hpp.
|
inline |
Helper function for running an existing HTTP-server on a thread pool.
Usage example:
Definition at line 586 of file http_server_run.hpp.
|
inlinenoexcept |
fd | Native file descriptor. |
meta | File meta data. |
chunk_size | The max size of a data to be send on a single iteration. |
Definition at line 468 of file sendfile.hpp.
|
inline |
file_path | Path to file. |
chunk_size | The max size of a data to be send on a single iteration. |
Definition at line 480 of file sendfile.hpp.
|
inline |
file_path | Path to file. |
chunk_size | The max size of a data to be send on a single iteration. |
Definition at line 494 of file sendfile.hpp.
|
inline |
file_path | Path to file. |
chunk_size | The max size of a data to be send on a single iteration. |
Definition at line 504 of file sendfile.hpp.
|
inlinenoexcept |
Make the indicator for absence of break signal handler.
Usage example:
Definition at line 69 of file http_server_run.hpp.
|
inline |
Definition at line 1975 of file http_headers.hpp.
|
inline |
Definition at line 2071 of file http_headers.hpp.
|
inline |
Definition at line 2011 of file http_headers.hpp.
|
inline |
Definition at line 2038 of file http_headers.hpp.
|
inline |
Definition at line 1963 of file http_headers.hpp.
|
inline |
Definition at line 1972 of file http_headers.hpp.
|
inline |
Definition at line 2062 of file http_headers.hpp.
|
inline |
Definition at line 2105 of file http_headers.hpp.
|
inline |
Definition at line 2020 of file http_headers.hpp.
|
inline |
Definition at line 1996 of file http_headers.hpp.
|
inline |
Definition at line 2077 of file http_headers.hpp.
|
inline |
Definition at line 2041 of file http_headers.hpp.
|
inline |
Definition at line 2080 of file http_headers.hpp.
|
inline |
Definition at line 2108 of file http_headers.hpp.
|
inline |
Definition at line 2065 of file http_headers.hpp.
|
inline |
Definition at line 2044 of file http_headers.hpp.
|
inline |
Definition at line 2102 of file http_headers.hpp.
|
inline |
Definition at line 2026 of file http_headers.hpp.
|
inline |
Definition at line 1993 of file http_headers.hpp.
|
inline |
Definition at line 2096 of file http_headers.hpp.
|
inline |
Definition at line 1990 of file http_headers.hpp.
|
inline |
Definition at line 2121 of file http_headers.hpp.
|
inline |
Definition at line 1981 of file http_headers.hpp.
|
inline |
Definition at line 1978 of file http_headers.hpp.
|
inline |
Definition at line 2029 of file http_headers.hpp.
|
inline |
Definition at line 2023 of file http_headers.hpp.
|
inline |
Definition at line 2068 of file http_headers.hpp.
|
inline |
Definition at line 2002 of file http_headers.hpp.
|
inline |
Definition at line 1969 of file http_headers.hpp.
|
inline |
Definition at line 1987 of file http_headers.hpp.
|
inline |
Definition at line 2050 of file http_headers.hpp.
|
inline |
Definition at line 2017 of file http_headers.hpp.
|
inline |
Definition at line 2089 of file http_headers.hpp.
|
inline |
Definition at line 2047 of file http_headers.hpp.
|
inline |
Definition at line 2112 of file http_headers.hpp.
|
inline |
Definition at line 2093 of file http_headers.hpp.
|
inline |
Definition at line 2032 of file http_headers.hpp.
|
inline |
Definition at line 2118 of file http_headers.hpp.
|
inline |
Definition at line 2035 of file http_headers.hpp.
|
inline |
Definition at line 2059 of file http_headers.hpp.
|
inline |
Definition at line 1984 of file http_headers.hpp.
|
inline |
Definition at line 1999 of file http_headers.hpp.
|
inline |
Definition at line 2074 of file http_headers.hpp.
|
inline |
Definition at line 1966 of file http_headers.hpp.
|
inline |
Definition at line 2008 of file http_headers.hpp.
|
inline |
Definition at line 2115 of file http_headers.hpp.
|
inline |
Definition at line 2014 of file http_headers.hpp.
|
inline |
Definition at line 2099 of file http_headers.hpp.
|
inline |
Definition at line 2056 of file http_headers.hpp.
|
inline |
Definition at line 2053 of file http_headers.hpp.
|
inline |
Definition at line 2005 of file http_headers.hpp.
|
inlinenoexcept |
Helper function to get method string name.
Definition at line 313 of file http_headers.hpp.
|
inlinenoexcept |
Make the indicator for usage of break signal handler.
Usage example:
Definition at line 50 of file http_server_run.hpp.
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value || std::is_same< Parameter_Container, router::route_params_t >::value, Value_Type >::type restinio::value_or | ( | const Parameter_Container & | params, |
string_view_t | key, | ||
Value_Type | default_value | ||
) |
Get parameter value or a given default.
Get the value of a parameter specified by key if parameter exists. If parameter exists in params it is obtained as string_view_t
object and casted to a necessary type and then returns. If params has no such parameters then the default_value is returned.
Definition at line 36 of file value_or.hpp.
constexpr file_size_t restinio::sendfile_default_chunk_size = 1024 * 1024 |
constexpr file_size_t restinio::sendfile_max_chunk_size = 1024 * 1024 * 1024 |