diff options
author | Daniil Baturin <daniil@baturin.org> | 2016-12-07 01:39:21 +0600 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2016-12-07 01:39:21 +0600 |
commit | 36eb9c91aafaa44cb3dc33b8e26bd2789f3a4ca1 (patch) | |
tree | fe4a056a9ec06a1dd2e4d5b3b69d9795f1ce5002 /src/message.mli | |
parent | 74a8cb375c3db7adb72c98edab96a9f12beddb62 (diff) | |
download | vyconf-36eb9c91aafaa44cb3dc33b8e26bd2789f3a4ca1.tar.gz vyconf-36eb9c91aafaa44cb3dc33b8e26bd2789f3a4ca1.zip |
Initial implementation of the message decoder/encoder.
Diffstat (limited to 'src/message.mli')
-rw-r--r-- | src/message.mli | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/message.mli b/src/message.mli index b610200..306afb7 100644 --- a/src/message.mli +++ b/src/message.mli @@ -6,10 +6,33 @@ type operation = | Delete of string list | Show of (string list option) * ((string * string) list option) | GetValues of string list + | Commit -type message = { +type request = { session_id: string; - ops: operation list + operations: operation list } -val decode : Yojson.Safe.json -> message +type response = { + errors: string list; + warnings: string list; + data: string list +} + +type raw_operation = { + method_name: string; + path: string list option; + options: (string * string) list option +} + +type raw_request = { + raw_session_id: string; + raw_operations: raw_operation list +} + +val encode_request : request -> Yojson.Safe.json +val decode_request : Yojson.Safe.json -> request + +val encode_response : response -> Yojson.Safe.json +val decode_response : Yojson.Safe.json -> response + |