|
Malloy
|
Writes the contents of a message to disk. More...
#include <file.hpp>
Public Types | |
| using | response_type = malloy::http::response< boost::beast::http::file_body > |
| using | request_type = malloy::http::request< boost::beast::http::file_body > |
| using | value_type = boost::beast::http::file_body::value_type |
| using | header_type = boost::beast::http::header< isRequest > |
| using | setup_handler_t = std::function< void(const header_type &, value_type &)> |
Public Member Functions | |
| basic_file ()=default | |
| Default ctor. | |
| basic_file (setup_handler_t setup_) | |
| Construct with a setup handler. | |
| basic_file (basic_file &&) noexcept=default | |
| basic_file & | operator= (basic_file &&) noexcept=default |
| std::variant< boost::beast::http::file_body > | body_for (const header_type &) const |
| void | setup_body (const header_type &h, value_type &body) const |
Static Public Member Functions | |
| static basic_file | open (const std::filesystem::path &location, std::function< void(malloy::error_code)> on_error, boost::beast::file_mode mode) |
| Create a version of the filter that writes/reads the specified file. | |
Public Attributes | |
| setup_handler_t | setup |
Writes the contents of a message to disk.
This filter is used to write a request/response directly to disk rather than storing it in-memory.
|
default |
Default ctor.
Calls to setup_body will do nothing until setup is set to a valid function
|
defaultnoexcept |
Move constructor.
|
inlinestatic |
Create a version of the filter that writes/reads the specified file.
| location | Path to the file on the local filesystem |
| on_error | Callback invoked on an error during handling of the request |
| mode | Mode to use when opening the file. Should not be a readonly mode (e.g. NOT boost::beast::file_mode::scan) |

|
defaultnoexcept |
Move-assignment operator.
| setup_handler_t malloy::http::filters::basic_file< isRequest >::setup |
The setup handler.