#pragma once #include using namespace seastar; using namespace httpd; #include class Database { public: explicit Database() = default; future stop(); future get(const sstring& key); future put(const sstring& key, sstring& val); future post(const sstring& key, input_stream* val); future del(const sstring& key); }; class GetHandler : public handler_base { public: explicit GetHandler(Database& db); future> handle(const sstring& path, std::unique_ptr req, std::unique_ptr rep) override; private: Database& db; }; class PutHandler : public handler_base { public: explicit PutHandler(Database& db); future> handle(const sstring& path, std::unique_ptr req, std::unique_ptr rep) override; private: Database& db; }; class PostHandler : public handler_base { public: explicit PostHandler(Database& db); future> handle(const sstring& path, std::unique_ptr req, std::unique_ptr rep) override; private: Database& db; }; class DeleteHandler : public handler_base { public: explicit DeleteHandler(Database& db); future> handle(const sstring& path, std::unique_ptr req, std::unique_ptr rep) override; private: Database& db; };