2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2017-11-14 03:36:14 +04:00
|
|
|
(* Copyright (c) 2014 - 2017. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
2017-11-27 09:13:12 +04:00
|
|
|
(** Typed RPC services: server implementation. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-11-27 09:13:12 +04:00
|
|
|
type cors = {
|
|
|
|
allowed_headers : string list ;
|
|
|
|
allowed_origins : string list ;
|
|
|
|
}
|
|
|
|
|
|
|
|
(** A handle on the server worker. *)
|
|
|
|
type server
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-11-27 09:13:12 +04:00
|
|
|
(** Promise a running RPC server.*)
|
|
|
|
val launch :
|
|
|
|
?host:string ->
|
|
|
|
?cors:cors ->
|
2017-12-07 20:43:21 +04:00
|
|
|
media_types:Media_type.t list ->
|
2017-11-27 09:13:12 +04:00
|
|
|
Conduit_lwt_unix.server ->
|
2017-12-09 06:51:58 +04:00
|
|
|
unit RPC_directory.t ->
|
2017-11-27 09:13:12 +04:00
|
|
|
server Lwt.t
|
2016-12-11 19:34:58 +04:00
|
|
|
|
2017-11-27 09:13:12 +04:00
|
|
|
(** Kill an RPC server. *)
|
|
|
|
val shutdown : server -> unit Lwt.t
|