summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vyconf_config.ml14
-rw-r--r--src/vyconf_config.mli10
2 files changed, 24 insertions, 0 deletions
diff --git a/src/vyconf_config.ml b/src/vyconf_config.ml
new file mode 100644
index 0000000..60ac2c9
--- /dev/null
+++ b/src/vyconf_config.ml
@@ -0,0 +1,14 @@
+type vyconf_config = {
+ app_name: string;
+ app_dir: string;
+ config_dir: string;
+ primary_config: string;
+ fallback_config: string;
+ socket: string;
+} [@@deriving yojson]
+
+
+let load filename =
+ try Yojson.Safe.from_file filename |> vyconf_config_of_yojson
+ with Sys_error msg -> `Error msg
+
diff --git a/src/vyconf_config.mli b/src/vyconf_config.mli
new file mode 100644
index 0000000..52060af
--- /dev/null
+++ b/src/vyconf_config.mli
@@ -0,0 +1,10 @@
+type vyconf_config = {
+ app_name: string;
+ app_dir: string;
+ config_dir: string;
+ primary_config: string;
+ fallback_config: string;
+ socket: string;
+}
+
+val load : string -> [ `Error of bytes | `Ok of vyconf_config ]