This commit is contained in:
Your Name
2025-04-30 22:32:17 +12:00
parent ce82cbc819
commit 4be22e1f48
5 changed files with 222 additions and 5016 deletions

View File

@@ -3,12 +3,13 @@
#include "config.hpp"
#include "httplib.hpp"
#include "litecask.hpp"
// #include "litecask.hpp" // Removed litecask
#include <string>
#include <memory>
#include <thread>
#include <atomic>
#include <filesystem>
#include <sqlite3.h> // Include SQLite header
namespace dropshell {
@@ -24,17 +25,20 @@ private:
void setup_routes();
void handle_get_object(const httplib::Request& req, httplib::Response& res);
void handle_get_hash(const httplib::Request& req, httplib::Response& res);
void handle_get_directory(const httplib::Request& req, httplib::Response& res);
void handle_get_directory(const httplib::Request& req, httplib::Response& res); // Re-add directory handler
void handle_put_object(const httplib::Request& req, httplib::Response& res);
bool validate_write_token(const std::string& token) const;
std::pair<std::string, std::string> parse_label_tag(const std::string& label_tag) const;
bool init_db(); // Helper for DB initialization
const ServerConfig& config_;
httplib::Server server_;
litecask::Datastore datastore_;
std::filesystem::path datastore_path_;
// Removed litecask members
sqlite3* db_ = nullptr; // SQLite database connection
std::filesystem::path db_path_;
std::atomic<bool> running_;
bool _isInitialized;
// Removed _isInitialized - will rely on db_ pointer
};
} // namespace dropshell