package resto-cohttp-self-serving-client

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

Make(Encoding) returns a module that provides an instance of Client.CALL in its launch function. The Client.CALL instance is meant to be passed to Client.Make to obtain a local, self-serving client: a client that is their own server.

A local, self-serving client is a client that performs RPCs on its own, without the need for a server. It does not open connections, sockets, files nor any such resource. Instead, it serves itself in-memory.

This can be used for testing, for example for mocking a distant server; or in the case where some functionalities can either be provided locally or by a distant server.

A local, self-serving client works the same as a server, except that its ACLs cannot be changed after constructing it (as opposed to Server.Make.set_acl).

Parameters

module Encoding : Resto.ENCODING

Signature

val launch : ?cors:Resto_cohttp.Cors.t -> ?agent:string -> ?acl:Resto_acl.Acl.t -> media_types:Resto_cohttp.Media_type.Make(Encoding).t list -> unit Resto_directory.Make(Encoding).directory -> (module Resto_cohttp_client.Client.CALL)
OCaml

Innovation. Community. Security.