cleanup
This commit is contained in:
parent
d691b469bf
commit
47197b9491
11 changed files with 106 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -40,4 +40,5 @@ build/
|
||||||
|
|
||||||
# other...
|
# other...
|
||||||
.direnv
|
.direnv
|
||||||
|
cmake-*
|
||||||
|
|
||||||
|
|
8
.idea/.gitignore
vendored
Normal file
8
.idea/.gitignore
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
7
.idea/codeStyles/Project.xml
Normal file
7
.idea/codeStyles/Project.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<clangFormatSettings>
|
||||||
|
<option name="ENABLED" value="true" />
|
||||||
|
</clangFormatSettings>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||||
|
</state>
|
||||||
|
</component>
|
7
.idea/inspectionProfiles/Project_Default.xml
Normal file
7
.idea/inspectionProfiles/Project_Default.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="TsLint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
</profile>
|
||||||
|
</component>
|
7
.idea/misc.xml
Normal file
7
.idea/misc.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CMakePythonSetting">
|
||||||
|
<option name="pythonIntegrationState" value="YES" />
|
||||||
|
</component>
|
||||||
|
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||||
|
</project>
|
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/noidb.iml" filepath="$PROJECT_DIR$/.idea/noidb.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
2
.idea/noidb.iml
Normal file
2
.idea/noidb.iml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
7
.idea/vcs.xml
Normal file
7
.idea/vcs.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$/seastar" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -1,3 +1,3 @@
|
||||||
add_executable(noidb)
|
add_executable(noidb)
|
||||||
target_sources(noidb PRIVATE noidb.cc database.cc api_handler.cc)
|
target_sources(noidb PRIVATE noidb.cc database.cc)
|
||||||
target_link_libraries(noidb PRIVATE Seastar::seastar)
|
target_link_libraries(noidb PRIVATE Seastar::seastar)
|
||||||
|
|
53
src/database.hh
Normal file
53
src/database.hh
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <seastar/http/httpd.hh>
|
||||||
|
|
||||||
|
using namespace seastar;
|
||||||
|
using namespace httpd;
|
||||||
|
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
class Database {
|
||||||
|
|
||||||
|
seastar::httpd::http_server_control& srv;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit Database(seastar::httpd::http_server_control& srv)
|
||||||
|
: srv(srv) {}
|
||||||
|
|
||||||
|
seastar::future<bool> stop();
|
||||||
|
};
|
||||||
|
|
||||||
|
class GetHandler : public handler_base {
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit GetHandler(Database& db);
|
||||||
|
|
||||||
|
future<std::unique_ptr<http::reply>> handle(const sstring& path, std::unique_ptr<http::request> req, std::unique_ptr<http::reply> rep) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Database& db;
|
||||||
|
};
|
||||||
|
|
||||||
|
class PutHandler : public handler_base {
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit PutHandler(Database& db);
|
||||||
|
|
||||||
|
future<std::unique_ptr<http::reply>> handle(const sstring& path, std::unique_ptr<http::request> req, std::unique_ptr<http::reply> rep) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Database& db;
|
||||||
|
};
|
||||||
|
|
||||||
|
class DeleteHandler : public handler_base {
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit DeleteHandler(Database& db);
|
||||||
|
|
||||||
|
future<std::unique_ptr<http::reply>> handle(const sstring& path, std::unique_ptr<http::request> req, std::unique_ptr<http::reply> rep) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Database& db;
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in a new issue