Pbrt_services.Server
Service stubs, server side
type ('req, 'req_mode, 'res, 'res_mode) rpc = {
name : string;
req_mode : 'req_mode mode;
res_mode : 'res_mode mode;
encode_json_res : 'res -> Yojson.Basic.t;
encode_pb_res : 'res -> Pbrt.Encoder.t -> unit;
decode_json_req : Yojson.Basic.t -> 'req;
decode_pb_req : Pbrt.Decoder.t -> 'req;
}
A single RPC method, alongside encoders and decoders for input and output types. .
val mk_rpc :
name:string ->
req_mode:'req_mode mode ->
res_mode:'res_mode mode ->
encode_json_res:('res -> Yojson.Basic.t) ->
encode_pb_res:('res -> Pbrt.Encoder.t -> unit) ->
decode_json_req:(Yojson.Basic.t -> 'req) ->
decode_pb_req:(Pbrt.Decoder.t -> 'req) ->
unit ->
('req, 'req_mode, 'res, 'res_mode) rpc
Helper to build a RPC
type 'h t = {
service_name : string;
Name of the service
*)package : string list;
The package this belongs in (e.g. "bigco.auth.secretpasswordstash"), split along "."
*)handlers : 'h list;
A list of handlers
*)}
A service with fixed set of methods, which depends on the concrete RPC implementation. Each method is a handler of some type 'h
.