diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-04-03 19:23:29 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-04-03 19:23:29 +0200 |
commit | 12972923e74e3dd174f3ce3e59c2db5ca9b400eb (patch) | |
tree | c1893aa2eefedb6cae317940bf6a63e24f1e733c /config.h | |
parent | d8c3333e7a7330c10bb96e426482e2b158011251 (diff) |
Configuration
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -1,6 +1,41 @@ #pragma once #include <string> +#include <unordered_map> +#include <vector> + +enum PathType +{ + Files, // serve files + Plugin // delegate to plugin +}; + +struct Path +{ + std::string requested; // the requested path + PathType type; + std::unordered_map<std::string, std::string> params; // what to serve, e.g. which filesystem path, or which plugin +}; + +struct Site +{ + std::string name; + std::string host; + std::vector<Path> 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<std::string> m_plugin_directories; + std::vector<Site> m_sites; + std::vector<Socket> 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; }; |