summaryrefslogtreecommitdiffhomepage
path: root/config.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-04-03 19:23:29 +0200
committerRoland Reichwein <mail@reichwein.it>2020-04-03 19:23:29 +0200
commit12972923e74e3dd174f3ce3e59c2db5ca9b400eb (patch)
treec1893aa2eefedb6cae317940bf6a63e24f1e733c /config.h
parentd8c3333e7a7330c10bb96e426482e2b158011251 (diff)
Configuration
Diffstat (limited to 'config.h')
-rw-r--r--config.h40
1 files changed, 40 insertions, 0 deletions
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 <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;
};