diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/message.ml | 11 | ||||
-rw-r--r-- | src/message.mli | 17 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/message.ml b/src/message.ml new file mode 100644 index 0000000..8f37c08 --- /dev/null +++ b/src/message.ml @@ -0,0 +1,11 @@ +type operation = { + method_name: string; + path: string list option; + value: string option; + options: (string * string) list option +} [@@deriving yojson] + +type message = { + session_id: string; + ops: operation list; +} [@@deriving yojson] 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 ] |