RPC: expose RPC base address in client context
This commit is contained in:
parent
fd72b47263
commit
2c57e4cce6
@ -78,6 +78,7 @@ class type full = object
|
|||||||
end
|
end
|
||||||
|
|
||||||
class proxy_context (obj : full) = object
|
class proxy_context (obj : full) = object
|
||||||
|
method base = obj#base
|
||||||
method block = obj#block
|
method block = obj#block
|
||||||
method answer : type a. (a, unit) lwt_format -> a = obj#answer
|
method answer : type a. (a, unit) lwt_format -> a = obj#answer
|
||||||
method call_service :
|
method call_service :
|
||||||
|
@ -59,6 +59,7 @@ class type json = object
|
|||||||
Uri.t ->
|
Uri.t ->
|
||||||
(Data_encoding.json, Data_encoding.json option)
|
(Data_encoding.json, Data_encoding.json option)
|
||||||
rest_result Lwt.t
|
rest_result Lwt.t
|
||||||
|
method base : Uri.t
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ class type json = object
|
|||||||
Uri.t ->
|
Uri.t ->
|
||||||
(Data_encoding.json, Data_encoding.json option)
|
(Data_encoding.json, Data_encoding.json option)
|
||||||
rest_result Lwt.t
|
rest_result Lwt.t
|
||||||
|
method base : Uri.t
|
||||||
end
|
end
|
||||||
|
|
||||||
class ['pr] of_directory : 'pr RPC_directory.t -> ['pr] gen
|
class ['pr] of_directory : 'pr RPC_directory.t -> ['pr] gen
|
||||||
|
@ -437,4 +437,5 @@ class http_ctxt config media_types : RPC_context.json =
|
|||||||
fun service ~on_chunk ~on_close params query body ->
|
fun service ~on_chunk ~on_close params query body ->
|
||||||
call_streamed_service media_types service
|
call_streamed_service media_types service
|
||||||
~logger ~base ~on_chunk ~on_close params query body
|
~logger ~base ~on_chunk ~on_close params query body
|
||||||
|
method base = base
|
||||||
end
|
end
|
||||||
|
@ -17,6 +17,7 @@ class type rpc_context = object
|
|||||||
end
|
end
|
||||||
|
|
||||||
class wrap_proto_context (t : RPC_context.json) : rpc_context = object
|
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 generic_json_call = t#generic_json_call
|
||||||
method call_service : 'm 'p 'q 'i 'o.
|
method call_service : 'm 'p 'q 'i 'o.
|
||||||
([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o) RPC_service.t ->
|
([< Resto.meth ] as 'm, unit, 'p, 'q, 'i, 'o) RPC_service.t ->
|
||||||
|
Loading…
Reference in New Issue
Block a user