Resto: minor renaming
This commit is contained in:
parent
375ddd48dc
commit
34cca61f7b
@ -7,15 +7,15 @@
|
|||||||
(* *)
|
(* *)
|
||||||
(**************************************************************************)
|
(**************************************************************************)
|
||||||
|
|
||||||
type cors = RestoCohttp.cors = {
|
type cors = Resto_cohttp.Server.cors = {
|
||||||
allowed_headers : string list ;
|
allowed_headers : string list ;
|
||||||
allowed_origins : string list ;
|
allowed_origins : string list ;
|
||||||
}
|
}
|
||||||
|
|
||||||
include RestoDirectory
|
include Resto_directory
|
||||||
module Directory = RestoDirectory.MakeDirectory(RPC.Data)
|
module Directory = Resto_directory.Make(RPC.Data)
|
||||||
|
|
||||||
include RestoCohttp.Make(RPC.Data)(Logging.RPC)
|
include Resto_cohttp.Server.Make(RPC.Data)(Logging.RPC)
|
||||||
|
|
||||||
let json = {
|
let json = {
|
||||||
name = "application/json" ;
|
name = "application/json" ;
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
|
|
||||||
module Directory :
|
module Directory :
|
||||||
(module type of struct include RestoDirectory.MakeDirectory(RPC.Data) end)
|
(module type of struct include Resto_directory.Make(RPC.Data) end)
|
||||||
include (module type of struct include RestoDirectory end)
|
include (module type of struct include Resto_directory end)
|
||||||
|
|
||||||
(** Typed RPC services: server implementation. *)
|
(** Typed RPC services: server implementation. *)
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
open Resto
|
open Resto
|
||||||
open Lwt.Infix
|
open Lwt.Infix
|
||||||
|
|
||||||
open RestoDirectory
|
open Resto_directory
|
||||||
module Directory = RestoDirectory.MakeDirectory(RestoJson.Encoding)
|
module Directory = Resto_directory.Make(Resto_json.Encoding)
|
||||||
open Directory
|
open Directory
|
||||||
|
|
||||||
module Answer = Answer
|
module Answer = Answer
|
@ -4,5 +4,4 @@
|
|||||||
((name ezresto_directory)
|
((name ezresto_directory)
|
||||||
(public_name ocplib-ezresto-directory)
|
(public_name ocplib-ezresto-directory)
|
||||||
(libraries (ocplib-ezresto ocplib-resto-directory))
|
(libraries (ocplib-ezresto ocplib-resto-directory))
|
||||||
(modules (EzRestoDirectory))
|
|
||||||
(wrapped false)))
|
(wrapped false)))
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
version: "dev"
|
version: "dev"
|
||||||
opam-version: "1.2"
|
opam-version: "1.2"
|
||||||
name: "ocplib-resto-directory"
|
|
||||||
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
license: "LGPL-2.1-with-OCaml-exception"
|
license: "LGPL-2.1-with-OCaml-exception"
|
||||||
@ -9,7 +8,6 @@ bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues"
|
|||||||
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
||||||
|
|
||||||
build: [
|
build: [
|
||||||
[ "jbuilder" "subst" "-n" "ocplib-resto" ] {pinned}
|
|
||||||
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
||||||
]
|
]
|
||||||
build-test: [
|
build-test: [
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
(**************************************************************************)
|
(**************************************************************************)
|
||||||
|
|
||||||
open EzServices
|
open EzServices
|
||||||
include EzRestoDirectory
|
include EzResto_directory
|
||||||
|
|
||||||
let rec repeat i json =
|
let rec repeat i json =
|
||||||
if i <= 0 then []
|
if i <= 0 then []
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
(executable
|
(executable
|
||||||
((name ezResto_test)
|
((name ezResto_test)
|
||||||
(modules (EzServices EzDirectory EzResto_test))
|
|
||||||
(libraries (ocplib-ezresto-directory lwt.unix))))
|
(libraries (ocplib-ezresto-directory lwt.unix))))
|
||||||
|
|
||||||
(alias
|
(alias
|
||||||
|
2
vendors/ocplib-resto/lib_ezresto/ezResto.ml
vendored
2
vendors/ocplib-resto/lib_ezresto/ezResto.ml
vendored
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
open Resto
|
open Resto
|
||||||
module Service = Resto.MakeService(RestoJson.Encoding)
|
module Service = Resto.MakeService(Resto_json.Encoding)
|
||||||
open Service
|
open Service
|
||||||
|
|
||||||
type meth = [ `GET | `POST | `DELETE | `PUT | `PATCH ]
|
type meth = [ `GET | `POST | `DELETE | `PUT | `PATCH ]
|
||||||
|
2
vendors/ocplib-resto/lib_ezresto/ezResto.mli
vendored
2
vendors/ocplib-resto/lib_ezresto/ezResto.mli
vendored
@ -80,7 +80,7 @@ end
|
|||||||
|
|
||||||
(** Services. *)
|
(** Services. *)
|
||||||
type ('meth, 'params, 'query, 'input, 'output, 'error) service =
|
type ('meth, 'params, 'query, 'input, 'output, 'error) service =
|
||||||
('meth, unit, 'params, 'query, 'input, 'output, 'error) Resto.MakeService(RestoJson.Encoding).service
|
('meth, unit, 'params, 'query, 'input, 'output, 'error) Resto.MakeService(Resto_json.Encoding).service
|
||||||
|
|
||||||
val get_service:
|
val get_service:
|
||||||
?description: string ->
|
?description: string ->
|
||||||
|
1
vendors/ocplib-resto/lib_ezresto/jbuild
vendored
1
vendors/ocplib-resto/lib_ezresto/jbuild
vendored
@ -4,5 +4,4 @@
|
|||||||
((name ezresto)
|
((name ezresto)
|
||||||
(public_name ocplib-ezresto)
|
(public_name ocplib-ezresto)
|
||||||
(libraries (ocplib-resto-json))
|
(libraries (ocplib-resto-json))
|
||||||
(modules (EzResto))
|
|
||||||
(wrapped false)))
|
(wrapped false)))
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
version: "dev"
|
version: "dev"
|
||||||
opam-version: "1.2"
|
opam-version: "1.2"
|
||||||
name: "ocplib-ezresto"
|
|
||||||
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
license: "LGPL-2.1-with-OCaml-exception"
|
license: "LGPL-2.1-with-OCaml-exception"
|
||||||
@ -9,7 +8,6 @@ bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues"
|
|||||||
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
||||||
|
|
||||||
build: [
|
build: [
|
||||||
[ "jbuilder" "subst" "-n" "ocplib-resto" ] {pinned}
|
|
||||||
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
||||||
]
|
]
|
||||||
build-test: [
|
build-test: [
|
||||||
|
4
vendors/ocplib-resto/lib_resto-cohttp/jbuild
vendored
4
vendors/ocplib-resto/lib_resto-cohttp/jbuild
vendored
@ -3,7 +3,5 @@
|
|||||||
(library
|
(library
|
||||||
((name resto_cohttp)
|
((name resto_cohttp)
|
||||||
(public_name ocplib-resto-cohttp)
|
(public_name ocplib-resto-cohttp)
|
||||||
(libraries (ocplib-resto-directory cohttp-lwt-unix))
|
(libraries (ocplib-resto-directory cohttp-lwt-unix))))
|
||||||
(modules (RestoCohttp))
|
|
||||||
(wrapped false)))
|
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
version: "dev"
|
version: "dev"
|
||||||
opam-version: "1.2"
|
opam-version: "1.2"
|
||||||
name: "ocplib-resto-cohttp"
|
|
||||||
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
license: "LGPL-2.1-with-OCaml-exception"
|
license: "LGPL-2.1-with-OCaml-exception"
|
||||||
@ -9,7 +8,6 @@ bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues"
|
|||||||
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
||||||
|
|
||||||
build: [
|
build: [
|
||||||
[ "jbuilder" "subst" "-n" "ocplib-resto" ] {pinned}
|
|
||||||
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
||||||
]
|
]
|
||||||
build-test: [
|
build-test: [
|
||||||
|
@ -104,7 +104,7 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct
|
|||||||
open Cohttp
|
open Cohttp
|
||||||
|
|
||||||
module Service = Resto.MakeService(Encoding)
|
module Service = Resto.MakeService(Encoding)
|
||||||
module Directory = RestoDirectory.MakeDirectory(Encoding)
|
module Directory = Resto_directory.Make(Encoding)
|
||||||
|
|
||||||
type media_type = {
|
type media_type = {
|
||||||
name: string ;
|
name: string ;
|
||||||
@ -158,7 +158,7 @@ module Make (Encoding : Resto.ENCODING)(Log : LOGGING) = struct
|
|||||||
if not !running then
|
if not !running then
|
||||||
Lwt.return None
|
Lwt.return None
|
||||||
else
|
else
|
||||||
s.RestoDirectory.Answer.next () >|= function
|
s.Resto_directory.Answer.next () >|= function
|
||||||
| None -> None
|
| None -> None
|
||||||
| Some x -> Some (to_string x)) in
|
| Some x -> Some (to_string x)) in
|
||||||
let shutdown () =
|
let shutdown () =
|
@ -48,7 +48,7 @@ module Make (Encoding : Resto.ENCODING) (Log : LOGGING) : sig
|
|||||||
?cors:cors ->
|
?cors:cors ->
|
||||||
media_types:media_type list ->
|
media_types:media_type list ->
|
||||||
Conduit_lwt_unix.server ->
|
Conduit_lwt_unix.server ->
|
||||||
unit RestoDirectory.MakeDirectory(Encoding).t ->
|
unit Resto_directory.Make(Encoding).t ->
|
||||||
server Lwt.t
|
server Lwt.t
|
||||||
|
|
||||||
(** Kill an RPC server. *)
|
(** Kill an RPC server. *)
|
@ -4,6 +4,5 @@
|
|||||||
((name resto_directory)
|
((name resto_directory)
|
||||||
(public_name ocplib-resto-directory)
|
(public_name ocplib-resto-directory)
|
||||||
(libraries (lwt ocplib-resto))
|
(libraries (lwt ocplib-resto))
|
||||||
(modules (RestoDirectory))
|
|
||||||
(wrapped false)))
|
(wrapped false)))
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
version: "dev"
|
version: "dev"
|
||||||
opam-version: "1.2"
|
opam-version: "1.2"
|
||||||
name: "ocplib-resto-directory"
|
|
||||||
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
license: "LGPL-2.1-with-OCaml-exception"
|
license: "LGPL-2.1-with-OCaml-exception"
|
||||||
@ -9,7 +8,6 @@ bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues"
|
|||||||
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
||||||
|
|
||||||
build: [
|
build: [
|
||||||
[ "jbuilder" "subst" "-n" "ocplib-resto" ] {pinned}
|
|
||||||
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
||||||
]
|
]
|
||||||
build-test: [
|
build-test: [
|
||||||
|
@ -42,7 +42,7 @@ module Answer = struct
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module MakeDirectory (Encoding : ENCODING) = struct
|
module Make (Encoding : ENCODING) = struct
|
||||||
|
|
||||||
module Service = Resto.MakeService(Encoding)
|
module Service = Resto.MakeService(Encoding)
|
||||||
|
|
@ -35,7 +35,7 @@ module Answer : sig
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module MakeDirectory (Encoding : ENCODING) : sig
|
module Make (Encoding : ENCODING) : sig
|
||||||
|
|
||||||
module Service : (module type of (struct include Resto.MakeService(Encoding) end))
|
module Service : (module type of (struct include Resto.MakeService(Encoding) end))
|
||||||
|
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
open Services
|
open Services
|
||||||
|
|
||||||
include RestoDirectory.MakeDirectory(RestoJson.Encoding)
|
include Resto_directory.Make(Resto_json.Encoding)
|
||||||
|
|
||||||
let rec repeat i json =
|
let rec repeat i json =
|
||||||
if i <= 0 then []
|
if i <= 0 then []
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
(executable
|
(executable
|
||||||
((name resto_test)
|
((name resto_test)
|
||||||
(modules (Services Directory Resto_test))
|
|
||||||
(libraries (ocplib-resto-directory ocplib-resto-json lwt.unix))))
|
(libraries (ocplib-resto-directory ocplib-resto-json lwt.unix))))
|
||||||
|
|
||||||
(alias
|
(alias
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
open Services
|
open Services
|
||||||
open Directory
|
open Directory
|
||||||
open RestoDirectory
|
open Resto_directory
|
||||||
open Lwt.Infix
|
open Lwt.Infix
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
(**************************************************************************)
|
(**************************************************************************)
|
||||||
|
|
||||||
open Resto
|
open Resto
|
||||||
module Service = MakeService(RestoJson.Encoding)
|
module Service = MakeService(Resto_json.Encoding)
|
||||||
open Service
|
open Service
|
||||||
|
|
||||||
(** Shared part *)
|
(** Shared part *)
|
||||||
|
1
vendors/ocplib-resto/lib_resto-json/jbuild
vendored
1
vendors/ocplib-resto/lib_resto-json/jbuild
vendored
@ -4,5 +4,4 @@
|
|||||||
((name resto_json)
|
((name resto_json)
|
||||||
(public_name ocplib-resto-json)
|
(public_name ocplib-resto-json)
|
||||||
(libraries (ocplib-json-typed ocplib-json-typed.bson ocplib-resto))
|
(libraries (ocplib-json-typed ocplib-json-typed.bson ocplib-resto))
|
||||||
(modules (RestoJson))
|
|
||||||
(wrapped false)))
|
(wrapped false)))
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
version: "dev"
|
version: "dev"
|
||||||
opam-version: "1.2"
|
opam-version: "1.2"
|
||||||
name: "ocplib-resto-json"
|
|
||||||
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
license: "LGPL-2.1-with-OCaml-exception"
|
license: "LGPL-2.1-with-OCaml-exception"
|
||||||
@ -9,7 +8,6 @@ bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues"
|
|||||||
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
||||||
|
|
||||||
build: [
|
build: [
|
||||||
[ "jbuilder" "subst" "-n" "ocplib-resto" ] {pinned}
|
|
||||||
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
||||||
]
|
]
|
||||||
build-test: [
|
build-test: [
|
||||||
|
1
vendors/ocplib-resto/lib_resto/jbuild
vendored
1
vendors/ocplib-resto/lib_resto/jbuild
vendored
@ -3,6 +3,5 @@
|
|||||||
(library
|
(library
|
||||||
((name resto)
|
((name resto)
|
||||||
(public_name ocplib-resto)
|
(public_name ocplib-resto)
|
||||||
(modules (Resto))
|
|
||||||
(flags (-w -30))
|
(flags (-w -30))
|
||||||
(wrapped false)))
|
(wrapped false)))
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
version: "dev"
|
version: "dev"
|
||||||
opam-version: "1.2"
|
opam-version: "1.2"
|
||||||
name: "ocplib-resto"
|
|
||||||
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
maintainer: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
authors: "Grégoire Henry <gregoire.henry@tezos.com>"
|
||||||
license: "LGPL-2.1-with-OCaml-exception"
|
license: "LGPL-2.1-with-OCaml-exception"
|
||||||
@ -9,7 +8,6 @@ bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues"
|
|||||||
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
dev-repo: "git+https://github.com/OCamlPro/ocplib-resto"
|
||||||
|
|
||||||
build: [
|
build: [
|
||||||
[ "jbuilder" "subst" "-n" "ocplib-resto" ] {pinned}
|
|
||||||
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
||||||
]
|
]
|
||||||
build-test: [
|
build-test: [
|
||||||
|
Loading…
Reference in New Issue
Block a user