diff options
Diffstat (limited to 'server/src/req_ctx.cppm')
| -rw-r--r-- | server/src/req_ctx.cppm | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/server/src/req_ctx.cppm b/server/src/req_ctx.cppm deleted file mode 100644 index 4a64d7d..0000000 --- a/server/src/req_ctx.cppm +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | module; | ||
| 2 | |||
| 3 | #include <boost/beast/http/message.hpp> | ||
| 4 | #include <boost/beast/http/verb.hpp> | ||
| 5 | |||
| 6 | export module routemon:req_ctx; | ||
| 7 | |||
| 8 | import :http.common; | ||
| 9 | import :trace; | ||
| 10 | |||
| 11 | namespace routemon { | ||
| 12 | |||
| 13 | export class req_ctx | ||
| 14 | { | ||
| 15 | trace::id tid_; | ||
| 16 | std::locale locale_; | ||
| 17 | http::verb_set route_verbs_; | ||
| 18 | bool keep_alive_; | ||
| 19 | bhttp::request_header<bhttp::fields> const& req_header_; | ||
| 20 | |||
| 21 | public: | ||
| 22 | explicit req_ctx( | ||
| 23 | trace::id tid, std::locale locale, http::verb_set route_verbs, | ||
| 24 | bool keep_alive, bhttp::request_header<bhttp::fields> const& req_header) | ||
| 25 | : tid_{tid}, locale_{locale}, route_verbs_{route_verbs}, | ||
| 26 | keep_alive_{keep_alive}, req_header_{req_header} | ||
| 27 | { | ||
| 28 | } | ||
| 29 | |||
| 30 | template <typename ReqBody> | ||
| 31 | explicit req_ctx( | ||
| 32 | trace::id tid, std::locale locale, http::verb_set route_verbs, | ||
| 33 | bhttp::request<ReqBody> const& req) | ||
| 34 | : req_ctx{tid, locale, route_verbs, req.keep_alive(), req.base()} | ||
| 35 | { | ||
| 36 | } | ||
| 37 | |||
| 38 | auto trace_id() const -> trace::id { return tid_; } | ||
| 39 | auto locale() const -> std::locale { return locale_; } | ||
| 40 | auto route_verbs() const -> http::verb_set { return route_verbs_; } | ||
| 41 | auto keep_alive() const -> bool { return keep_alive_; } | ||
| 42 | auto req_header() const -> bhttp::request_header<bhttp::fields> const& | ||
| 43 | { | ||
| 44 | return req_header_; | ||
| 45 | } | ||
| 46 | }; | ||
| 47 | |||
| 48 | } // namespace routemon | ||