diff options
-rw-r--r-- | _oasis | 6 | ||||
-rw-r--r-- | _tags | 5 | ||||
-rw-r--r-- | myocamlbuild.ml | 5 | ||||
-rw-r--r-- | setup.ml | 149 | ||||
-rw-r--r-- | src/message.ml | 76 | ||||
-rw-r--r-- | src/message.mli | 38 |
6 files changed, 6 insertions, 273 deletions
@@ -77,12 +77,6 @@ Library "directories" FindlibParent: vyconf BuildDepends: fileutils -Library "message" - Path: src - Modules: Message - FindlibParent: vyconf - BuildDepends: ppx_deriving_yojson - Library "startup" Path: src Modules: Startup @@ -1,5 +1,5 @@ # OASIS_START -# DO NOT EDIT (digest: c2be8ef2e29762b40de09512178308e2) +# DO NOT EDIT (digest: 38b8e5e5c233095a76ae7d14148f4787) # Ignore VCS directories, you can use the same kind of rule outside # OASIS_START/STOP if you want to exclude directories that contains # useless stuff for the build process @@ -42,9 +42,6 @@ true: annot, bin_annot <src/*.ml{,i,y}>: pkg_ppx_deriving.show # Library directories "src/directories.cmxs": use_directories -# Library message -"src/message.cmxs": use_message -<src/*.ml{,i,y}>: pkg_ppx_deriving_yojson # Library startup "src/startup.cmxs": use_startup <src/*.ml{,i,y}>: pkg_lwt.log diff --git a/myocamlbuild.ml b/myocamlbuild.ml index 5f949e0..2012409 100644 --- a/myocamlbuild.ml +++ b/myocamlbuild.ml @@ -1,5 +1,5 @@ (* OASIS_START *) -(* DO NOT EDIT (digest: 58bff247d86c1c73243351c92c8e76a6) *) +(* DO NOT EDIT (digest: 8452cc385560a63fa70df22ac20ce33d) *) module OASISGettext = struct (* # 22 "src/oasis/OASISGettext.ml" *) @@ -899,7 +899,6 @@ let package_default = ("session", ["src"], []); ("vyconf_config", ["src"], []); ("directories", ["src"], []); - ("message", ["src"], []); ("startup", ["src"], []) ]; lib_c = []; @@ -912,6 +911,6 @@ let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false} let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;; -# 916 "myocamlbuild.ml" +# 915 "myocamlbuild.ml" (* OASIS_STOP *) Ocamlbuild_plugin.dispatch dispatch_default;; @@ -1,7 +1,7 @@ (* setup.ml generated for the first time by OASIS v0.4.8 *) (* OASIS_START *) -(* DO NOT EDIT (digest: 6648bc241749672812679ffa81a71ffe) *) +(* DO NOT EDIT (digest: 411e3584b87f0eb61c76f19c8ab886db) *) (* Regenerated by OASIS v0.4.8 Visit http://oasis.forge.ocamlcore.org for more information and @@ -8938,149 +8938,6 @@ let setup_t = }); Library ({ - cs_name = "message"; - cs_data = PropList.Data.create (); - cs_plugin_data = [] - }, - { - bs_build = [(OASISExpr.EBool true, true)]; - bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "src"; - bs_compiled_object = Best; - bs_build_depends = - [FindlibPackage ("ppx_deriving_yojson", None)]; - bs_build_tools = [ExternalTool "ocamlbuild"]; - bs_interface_patterns = - [ - { - OASISSourcePatterns.Templater.atoms = - [ - OASISSourcePatterns.Templater.Text ""; - OASISSourcePatterns.Templater.Expr - (OASISSourcePatterns.Templater.Call - ("capitalize_file", - OASISSourcePatterns.Templater.Ident - "module")); - OASISSourcePatterns.Templater.Text ".mli" - ]; - origin = "${capitalize_file module}.mli" - }; - { - OASISSourcePatterns.Templater.atoms = - [ - OASISSourcePatterns.Templater.Text ""; - OASISSourcePatterns.Templater.Expr - (OASISSourcePatterns.Templater.Call - ("uncapitalize_file", - OASISSourcePatterns.Templater.Ident - "module")); - OASISSourcePatterns.Templater.Text ".mli" - ]; - origin = "${uncapitalize_file module}.mli" - } - ]; - bs_implementation_patterns = - [ - { - OASISSourcePatterns.Templater.atoms = - [ - OASISSourcePatterns.Templater.Text ""; - OASISSourcePatterns.Templater.Expr - (OASISSourcePatterns.Templater.Call - ("capitalize_file", - OASISSourcePatterns.Templater.Ident - "module")); - OASISSourcePatterns.Templater.Text ".ml" - ]; - origin = "${capitalize_file module}.ml" - }; - { - OASISSourcePatterns.Templater.atoms = - [ - OASISSourcePatterns.Templater.Text ""; - OASISSourcePatterns.Templater.Expr - (OASISSourcePatterns.Templater.Call - ("uncapitalize_file", - OASISSourcePatterns.Templater.Ident - "module")); - OASISSourcePatterns.Templater.Text ".ml" - ]; - origin = "${uncapitalize_file module}.ml" - }; - { - OASISSourcePatterns.Templater.atoms = - [ - OASISSourcePatterns.Templater.Text ""; - OASISSourcePatterns.Templater.Expr - (OASISSourcePatterns.Templater.Call - ("capitalize_file", - OASISSourcePatterns.Templater.Ident - "module")); - OASISSourcePatterns.Templater.Text ".mll" - ]; - origin = "${capitalize_file module}.mll" - }; - { - OASISSourcePatterns.Templater.atoms = - [ - OASISSourcePatterns.Templater.Text ""; - OASISSourcePatterns.Templater.Expr - (OASISSourcePatterns.Templater.Call - ("uncapitalize_file", - OASISSourcePatterns.Templater.Ident - "module")); - OASISSourcePatterns.Templater.Text ".mll" - ]; - origin = "${uncapitalize_file module}.mll" - }; - { - OASISSourcePatterns.Templater.atoms = - [ - OASISSourcePatterns.Templater.Text ""; - OASISSourcePatterns.Templater.Expr - (OASISSourcePatterns.Templater.Call - ("capitalize_file", - OASISSourcePatterns.Templater.Ident - "module")); - OASISSourcePatterns.Templater.Text ".mly" - ]; - origin = "${capitalize_file module}.mly" - }; - { - OASISSourcePatterns.Templater.atoms = - [ - OASISSourcePatterns.Templater.Text ""; - OASISSourcePatterns.Templater.Expr - (OASISSourcePatterns.Templater.Call - ("uncapitalize_file", - OASISSourcePatterns.Templater.Ident - "module")); - OASISSourcePatterns.Templater.Text ".mly" - ]; - origin = "${uncapitalize_file module}.mly" - } - ]; - bs_c_sources = []; - bs_data_files = []; - bs_findlib_extra_files = []; - bs_ccopt = [(OASISExpr.EBool true, [])]; - bs_cclib = [(OASISExpr.EBool true, [])]; - bs_dlllib = [(OASISExpr.EBool true, [])]; - bs_dllpath = [(OASISExpr.EBool true, [])]; - bs_byteopt = [(OASISExpr.EBool true, [])]; - bs_nativeopt = [(OASISExpr.EBool true, [])] - }, - { - lib_modules = ["Message"]; - lib_pack = false; - lib_internal_modules = []; - lib_findlib_parent = Some "vyconf"; - lib_findlib_name = None; - lib_findlib_directory = None; - lib_findlib_containers = [] - }); - Library - ({ cs_name = "startup"; cs_data = PropList.Data.create (); cs_plugin_data = [] @@ -10956,7 +10813,7 @@ let setup_t = }; oasis_fn = Some "_oasis"; oasis_version = "0.4.8"; - oasis_digest = Some "`\144\186'\244h\229%q\147\213P+\217$\207"; + oasis_digest = Some "\007\199+\142\186\142<4#\132\203\130\253_\216;"; oasis_exec = None; oasis_setup_args = []; setup_update = false @@ -10964,7 +10821,7 @@ let setup_t = let setup () = BaseSetup.setup setup_t;; -# 10968 "setup.ml" +# 10825 "setup.ml" let setup_t = BaseCompat.Compat_0_4.adapt_setup_t setup_t open BaseCompat.Compat_0_4 (* OASIS_STOP *) diff --git a/src/message.ml b/src/message.ml deleted file mode 100644 index b79d5cd..0000000 --- a/src/message.ml +++ /dev/null @@ -1,76 +0,0 @@ -exception Invalid_operation of string -exception Invalid_message of string - -type operation = - | Set of string list - | Delete of string list - | Show of (string list option) * ((string * string) list option) - | GetValues of string list - | Commit - -type request = { - session_id: string; - operations: operation list; -} - -type response = { - errors: string list; - warnings: string list; - data: string list; -} [@@deriving yojson] - -type raw_operation = { - method_name: string; - path: string list option; - options: (string * string) list option -} [@@deriving yojson] - -type raw_request = { - raw_session_id: string; - raw_operations: raw_operation list; -} [@@deriving yojson] - - -let value_of_path p = - match p with - | Some p -> p - | None -> raise (Invalid_operation "Operation requires a path") - -let decode_operation op = - let op_name = op.method_name in - match op_name with - | "set" -> Set (value_of_path op.path) - | "delete" -> Delete (value_of_path op.path) - | "show" -> Show (op.path, op.options) - | "get_values" -> - (match op.path with - | Some path -> GetValues path - | None -> raise (Invalid_operation "Operation requires a path")) - | "commit" -> Commit - | _ -> raise (Invalid_operation "Invalid operation name") - -let encode_raw_operation op = - match op with - | Set path -> {method_name = "set"; path = Some path; options = None} - | Delete path -> {method_name = "delete"; path = Some path; options = None} - | Show (path, options) -> {method_name = "show"; path = path; options = options} - | Commit -> {method_name = "commit"; path = None; options = None} - | _ -> raise (Invalid_operation "Unimplemented") - -let decode_request j = - let req = raw_request_of_yojson j in - match req with - | Result.Ok req -> {session_id=req.raw_session_id; operations=(List.map decode_operation req.raw_operations)} - | Result.Error str -> raise (Invalid_message str) - -let encode_request req = - let raw_req = {raw_session_id=req.session_id; raw_operations=(List.map encode_raw_operation req.operations)} in - raw_request_to_yojson raw_req - -let encode_response = response_to_yojson - -let decode_response j = - let result = response_of_yojson j in - match result with - | Result.Ok response -> response - | Result.Error str -> raise (Invalid_message str) diff --git a/src/message.mli b/src/message.mli deleted file mode 100644 index 306afb7..0000000 --- a/src/message.mli +++ /dev/null @@ -1,38 +0,0 @@ -exception Invalid_operation of string -exception Invalid_message of string - -type operation = - | Set of string list - | Delete of string list - | Show of (string list option) * ((string * string) list option) - | GetValues of string list - | Commit - -type request = { - session_id: string; - operations: operation list -} - -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 - |