Malloy
|
#include <generator.hpp>
Public Member Functions | |
generator ()=default | |
generator (const generator &other)=delete | |
generator (generator &&other)=delete | |
virtual | ~generator ()=default |
generator & | operator= (const generator &rhs)=delete |
generator & | operator= (generator &&rhs)=delete |
Static Public Member Functions | |
static response | ok () |
static response | redirect (status code, std::string_view location) |
static response | bad_request (std::string_view reason) |
static response | not_found (std::string_view resource) |
static response | server_error (std::string_view what) |
template<malloy::http::concepts::body Body> | |
static file_response | file (const request< Body > &req, const std::filesystem::path &storage_base_path) |
static file_response | file (const std::filesystem::path &storage_path, std::string_view rel_path) |
A generator for HTTP responses.
|
default |
Default constructor.
|
virtualdefault |
Destructor
|
static |
Construct a 400 error.
reason | An explanation of why this request is considered a bad one. |
|
inlinestatic |
Construct a file response.
req | The request to be responded to. |
storage_base_path | The base path to the local filesystem. |
|
static |
Construct a file response.
storage_path | The base path to the local filesystem. |
rel_path | The file being requested relative to the storage_path. |
|
static |
Construct a 404 error.
resource | The resource that was being requested. |
|
static |
Construct a 200 response.
Construct a 3xx response.
code | The HTTP status code. Must be a 3xx status code. |
location | The location to redirect to. |
|
static |
Construct a 500 error.
what | An optional error message. |