|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
HTTP过滤器链 更多...
#include <http_filter.hpp>
Public 成员函数 | |
| void | add_filter (unique_ptr< http_filter > filter) |
| 添加过滤器(转移所有权) | |
| void | add_filter_ref (http_filter *filter) |
| 添加过滤器(不转移所有权) | |
| void | clear () noexcept |
| 清空所有过滤器 | |
| size_t | size () const noexcept |
| 获取过滤器数量 | |
| bool | empty () const noexcept |
| 检查过滤器链是否为空 | |
| bool | execute_pre_filters (http_request &request, http_response &response) |
| 执行所有预过滤器 | |
| void | execute_post_filters (http_request &request, http_response &response) |
| 执行所有后过滤器 | |
| void | execute_pre_filters_async (http_request &request, http_response &response, http_context &ctx, function< void(bool)> next) |
| 异步执行所有预过滤器(回调链模式) | |
| void | execute_post_filters_async (http_request &request, http_response &response, http_context &ctx, function< void()> next) |
| 异步执行所有后过滤器(回调链模式) | |
| void | execute_filters (http_request &request, http_response &response) |
| 执行所有核心过滤器 | |
| void neforce::http::http_filter_chain::add_filter | ( | unique_ptr< http_filter > | filter | ) |
添加过滤器(转移所有权)
| filter | 过滤器智能指针 |
| void neforce::http::http_filter_chain::add_filter_ref | ( | http_filter * | filter | ) |
添加过滤器(不转移所有权)
| filter | 过滤器原始指针 |
|
inlinenodiscardnoexcept |
| void neforce::http::http_filter_chain::execute_filters | ( | http_request & | request, |
| http_response & | response ) |
执行所有核心过滤器
| request | HTTP请求 |
| response | HTTP响应 |
| void neforce::http::http_filter_chain::execute_post_filters | ( | http_request & | request, |
| http_response & | response ) |
执行所有后过滤器
| request | HTTP请求 |
| response | HTTP响应 |
| void neforce::http::http_filter_chain::execute_post_filters_async | ( | http_request & | request, |
| http_response & | response, | ||
| http_context & | ctx, | ||
| function< void()> | next ) |
| bool neforce::http::http_filter_chain::execute_pre_filters | ( | http_request & | request, |
| http_response & | response ) |
执行所有预过滤器
| request | HTTP请求 |
| response | HTTP响应 |
| void neforce::http::http_filter_chain::execute_pre_filters_async | ( | http_request & | request, |
| http_response & | response, | ||
| http_context & | ctx, | ||
| function< void(bool)> | next ) |
异步执行所有预过滤器(回调链模式)
| request | HTTP请求 |
| response | HTTP响应 |
| ctx | 请求上下文 |
| next | 所有过滤器通过后调用 next(true),任一中断调用 next(false) |
引用了 neforce::next().
|
inlinenodiscardnoexcept |