From f50401c6bdfb205f34de3d04949fbaf3cd6876f8 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 28 Sep 2015 20:51:58 +0600 Subject: Add types and derivers for the message decoder. --- src/message.mli | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/message.mli (limited to 'src/message.mli') diff --git a/src/message.mli b/src/message.mli new file mode 100644 index 0000000..6de77b7 --- /dev/null +++ b/src/message.mli @@ -0,0 +1,17 @@ +type operation = { + method_name: string; + path: string list option; + value: string option; + options: (string * string) list option +} + +type message = { + session_id: string; + ops: operation list; +} + +val operation_to_yojson : operation -> Yojson.Safe.json +val operation_of_yojson : Yojson.Safe.json -> [ `Error of bytes | `Ok of operation ] + +val message_to_yojson : message -> Yojson.Safe.json +val message_of_yojson : Yojson.Safe.json -> [ `Error of bytes | `Ok of message ] -- cgit v1.2.3