DB: remove shared stuff, add singleton

Add Config class
This commit is contained in:
2024-01-28 22:36:38 -03:00
parent 297786133d
commit fbf487051e
5 changed files with 75 additions and 5 deletions

21
source/config.d Normal file
View File

@@ -0,0 +1,21 @@
module config;
import std.json;
import std.file;
import slf4d;
class Config {
JSONValue v;
private string m_path;
this(string path = "./config.json") {
this.m_path = path;
}
void load() {
debugF!"Trying to load config from %s"(this.m_path);
string contents = readText(this.m_path);
this.v = parseJSON(contents);
}
}