RPC: expose RPC base address in client context

This commit is contained in:
James Deikun 2018-05-18 15:14:44 -04:00 committed by Grégoire Henry
parent fd72b47263
commit 2c57e4cce6
5 changed files with 5 additions and 0 deletions

View File

@ -78,6 +78,7 @@ class type full = object
end
class proxy_context (obj : full) = object
method base = obj#base
method block = obj#block
method answer : type a. (a, unit) lwt_format -> a = obj#answer
method call_service :

View File

@ -59,6 +59,7 @@ class type json = object
Uri.t ->
(Data_encoding.json, Data_encoding.json option)
rest_result Lwt.t
method base : Uri.t
end

View File

@ -59,6 +59,7 @@ class type json = object
Uri.t ->
(Data_encoding.json, Data_encoding.json option)
rest_result Lwt.t
method base : Uri.t
end
class ['pr] of_directory : 'pr RPC_directory.t -> ['pr] gen

View File

@ -437,4 +437,5 @@ class http_ctxt config media_types : RPC_context.json =
fun service ~on_chunk ~on_close params query body ->
call_streamed_service media_types service
~logger ~base ~on_chunk ~on_close params query body
method base = base
end

View File

@ -17,6 +17,7 @@ class type rpc_context = object
end
class wrap_proto_context (t : RPC_context.json) : rpc_context = object
method base : Uri.t = t#base
method generic_json_call = t#generic_json_call
method call_service : 'm 'p 'q 'i 'o.
([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o) RPC_service.t ->