package pbrt_services

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Service stubs, client side

type _ mode =
  1. | Unary : Value_mode.unary mode
  2. | Stream : Value_mode.stream mode
type ('req, 'req_mode, 'res, 'res_mode) rpc = {
  1. service_name : string;
  2. package : string list;
    (*

    Package for the service

    *)
  3. rpc_name : string;
  4. req_mode : 'req_mode mode;
  5. res_mode : 'res_mode mode;
  6. encode_json_req : 'req -> Yojson.Basic.t;
  7. encode_pb_req : 'req -> Pbrt.Encoder.t -> unit;
  8. decode_json_res : Yojson.Basic.t -> 'res;
  9. 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
OCaml

Innovation. Community. Security.