/
smychkov
/
SStorage
Обзор
Документация
Войти
/
smychkov
/
SStorage
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/server/server.hpp
43 строки
1 KB
Андрей Смычков
feat: HTTP + gRPC servers with new key-value API
25 апр 2026, 09:21
25 апр 2026, 09:21
1c6add8
Код
Авторство
О чём код?
#ifndef SSTORAGE_SERVER_SERVER_HPP #define SSTORAGE_SERVER_SERVER_HPP //============================================================================ // Server — объединяет HTTP и gRPC обработчики //============================================================================ // Запускает тот(те), который(е) указан(ы) в mode: "http", "grpc", "both". //============================================================================ #include <cstdint> #include <memory> #include <string> namespace sstorage { class Database; class HttpHandler; class GrpcHandler; class Server { public: Server(Database& db, uint16_t httpPort, uint16_t grpcPort, const std::string& mode); ~Server(); bool start(); void stop(); bool isHttpRunning() const; bool isGrpcRunning() const; private: Database& db_; uint16_t httpPort_; uint16_t grpcPort_; std::string mode_; std::unique_ptr<HttpHandler> httpHandler_; std::unique_ptr<GrpcHandler> grpcHandler_; }; } #endif