From 12972923e74e3dd174f3ce3e59c2db5ca9b400eb Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 3 Apr 2020 19:23:29 +0200 Subject: Configuration --- config.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'config.h') diff --git a/config.h b/config.h index b1f17a3..e69b298 100644 --- a/config.h +++ b/config.h @@ -1,6 +1,41 @@ #pragma once #include +#include +#include + +enum PathType +{ + Files, // serve files + Plugin // delegate to plugin +}; + +struct Path +{ + std::string requested; // the requested path + PathType type; + std::unordered_map params; // what to serve, e.g. which filesystem path, or which plugin +}; + +struct Site +{ + std::string name; + std::string host; + std::vector paths; +}; + +enum SocketProtocol +{ + HTTP, + HTTPS +}; + +struct Socket +{ + std::string address; + std::string port; + SocketProtocol protocol; +}; class Config { @@ -10,6 +45,9 @@ class Config std::string m_user; std::string m_group; + std::vector m_plugin_directories; + std::vector m_sites; + std::vector m_sockets; public: Config(const std::string& filename); @@ -17,5 +55,7 @@ class Config // Data getters std::string User() const; std::string Group() const; + + void dump() const; }; -- cgit v1.2.3