Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Service stubs, client side
type ('req, 'req_mode, 'res, 'res_mode) rpc = {
service_name : string;
package : string list;
Package for the service
*)rpc_name : string;
req_mode : 'req_mode mode;
res_mode : 'res_mode mode;
encode_json_req : 'req -> Yojson.Basic.t;
encode_pb_req : 'req -> Pbrt.Encoder.t -> unit;
decode_json_res : Yojson.Basic.t -> 'res;
decode_pb_res : Pbrt.Decoder.t -> 'res;
}
A RPC description. You need a transport library that knows where to send the bytes to actually use it.
val mk_rpc :
?package:string list ->
service_name:string ->
rpc_name:string ->
req_mode:'req_mode mode ->
res_mode:'res_mode mode ->
encode_json_req:('req -> Yojson.Basic.t) ->
encode_pb_req:('req -> Pbrt.Encoder.t -> unit) ->
decode_json_res:(Yojson.Basic.t -> 'res) ->
decode_pb_res:(Pbrt.Decoder.t -> 'res) ->
unit ->
('req, 'req_mode, 'res, 'res_mode) rpc