28#include <seastar/http/common.hh>
29#include <seastar/core/sstring.hh>
30#include <seastar/http/routes.hh>
31#include <seastar/http/function_handlers.hh>
32#include <seastar/util/modules.hh>
58 : method(method), nickname(nickname) {
61 operation_type method;
84 enum class url_component_type {
86 PARAM_UNTIL_END_OF_PATH,
94 url_component_type type = url_component_type::PARAM;
112 const sstring& nickname,
113 const std::vector<std::pair<sstring, bool>>& path_parameters,
114 const std::vector<sstring>& mandatory_params);
126 const sstring& nickname,
127 const std::initializer_list<path_part>& path_parameters,
128 const std::vector<sstring>& mandatory_params);
147 bool all_path =
false) {
148 params.push_back( { param, (all_path) ? url_component_type::PARAM_UNTIL_END_OF_PATH : url_component_type::PARAM});
162 params.push_back( {
url, url_component_type::FIXED_STRING});
172 mandatory_queryparams.push_back(param);
176 std::vector<path_part> params;
179 mutable routes::rule_cookie _cookie;
181 std::vector<sstring> mandatory_queryparams;
185 void set(
routes& _routes,
const json_request_function& f)
const;
187 void set(
routes& _routes,
const future_json_function& f)
const;
189 void unset(
routes& _routes)
const;
Definition: handlers.hh:42
Seastar API namespace.
Definition: abort_on_ebadf.hh:26
Definition: json_path.hh:44
json_operation(operation_type method, const sstring &nickname)
Definition: json_path.hh:57
json_operation()
Definition: json_path.hh:48
Definition: json_path.hh:82
path_description(const sstring &path, operation_type method, const sstring &nickname, const std::initializer_list< path_part > &path_parameters, const std::vector< sstring > &mandatory_params)
path_description * push_static_path_part(const sstring &url)
adds a fixed string as part of the path This will allow to combine fixed string URL parts and path pa...
Definition: json_path.hh:161
path_description(const sstring &path, operation_type method, const sstring &nickname, const std::vector< std::pair< sstring, bool > > &path_parameters, const std::vector< sstring > &mandatory_params)
path_description * pushmandatory_param(const sstring ¶m)
Definition: json_path.hh:171
path_description()=default
path_description * pushparam(const sstring ¶m, bool all_path=false)
Definition: json_path.hh:146
Definition: json_path.hh:92