summaryrefslogtreecommitdiff
path: root/src/vyconf_client.mli
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2017-01-15 23:07:39 +0700
committerDaniil Baturin <daniil@baturin.org>2017-01-15 23:07:39 +0700
commit291a998ca375077b3c23c1e3c43a7fc206c8de4b (patch)
treef107bee0f33a747f9375a0a76932ac38b69f29c7 /src/vyconf_client.mli
parentfa6a9c8b5d8d127bbce810aa14d4468de437469f (diff)
downloadvyconf-291a998ca375077b3c23c1e3c43a7fc206c8de4b.tar.gz
vyconf-291a998ca375077b3c23c1e3c43a7fc206c8de4b.zip
Add functionality for socket communication.
The Message module contains read and write functions that take care of the wire protocol, which sends a 4 byte length header before every message. They take a bytes buffer and don't care about its contents. The Vyconf_client module has high level functions for interfacing with vyconfd. Functions for creating a socket and creating a server loop are in Startup. The rest is, for now at least, right in vyconfd. Notes: Message.read/write probably should be wrapped in Lwt_io.atomic We need to find out if it's safe to reuse Pbrt.Encoder.t or we really should create it every time.
Diffstat (limited to 'src/vyconf_client.mli')
-rw-r--r--src/vyconf_client.mli26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vyconf_client.mli b/src/vyconf_client.mli
new file mode 100644
index 0000000..87fffdd
--- /dev/null
+++ b/src/vyconf_client.mli
@@ -0,0 +1,26 @@
+type t
+
+type status =
+ | Success
+ | Fail
+ | Invalid_path
+ | Invalid_value
+ | Commit_in_progress
+ | Configuration_locked
+ | Internal_error
+ | Permission_denied
+ | Path_already_exists
+
+type response = {
+ status : status;
+ output : string option;
+ error : string option;
+ warning : string option;
+}
+
+
+val create : string -> t Lwt.t
+
+val shutdown : t -> t Lwt.t
+
+val get_status : t -> response Lwt.t