Module Conduit_mirage

Functorial connection establishment interface that is compatible with the Mirage libraries.

module Flow : Mirage_flow_lwt.S

Dynamic flows.

type callback = Flow.flow -> unit Lwt.t

The type for callback values.

module type Handler = sig ... end

TCP

type tcp_client = [
| `TCP of Ipaddr.t * int
]

address and destination port

and tcp_server = [
| `TCP of int
]

address and destination port

listening port

type 'a stackv4
val stackv4 : (module Mirage_stack_lwt.V4 with type t = 'a) -> 'a stackv4

VCHAN

type vchan_client = [
| `Vchan of [ `Direct of int * Vchan.Port.t | `Domain_socket of string * Vchan.Port.t ]
]
type vchan_server = [
| `Vchan of [ `Direct of int * Vchan.Port.t | `Domain_socket ]
]
module type VCHAN = Vchan.S.ENDPOINT with type port = Vchan.Port.t
module type XS = Xs_client_lwt.S
type vchan
type xs
val vchan : (module VCHAN) -> vchan
val xs : (module XS) -> xs

TLS

type 'a tls_client = [
| `TLS of Tls.Config.client * 'a
]
type 'a tls_server = [
| `TLS of Tls.Config.server * 'a
]
type client = [
| tcp_client
| vchan_client
| client tls_client
]

The type for client configuration values.

val sexp_of_client : client -> Ppx_sexp_conv_lib.Sexp.t
val client_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> client
val __client_of_sexp__ : Ppx_sexp_conv_lib.Sexp.t -> client
type server = [
| tcp_server
| vchan_server
| server tls_server
]

The type for server configuration values.

val sexp_of_server : server -> Ppx_sexp_conv_lib.Sexp.t
val server_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> server
val __server_of_sexp__ : Ppx_sexp_conv_lib.Sexp.t -> server
val client : Conduit.endp -> client Lwt.t

Resolve a conduit endpoint into a client configuration.

val server : Conduit.endp -> server Lwt.t

Resolve a confuit endpoint into a server configuration.

type conduit

The type for conduit values.

module type S = sig ... end
include S
type t = conduit
val empty : t

The empty conduit.

module With_tcp : functor (S : Mirage_stack_lwt.V4) -> sig ... end
val with_tcp : t -> 'a stackv4 -> 'a -> t Lwt.t

Extend a conduit with an implementation for TCP.

val with_tls : t -> t Lwt.t

Extend a conduit with an implementation for TLS.

val with_vchan : t -> xs -> vchan -> string -> t Lwt.t

Extend a conduit with an implementation for VCHAN.

val connect : t -> client -> Flow.flow Lwt.t

Connect a conduit using a client configuration value.

val listen : t -> server -> callback -> unit Lwt.t

Configure a server using a conduit configuration value.

module Context : functor (T : Mirage_time_lwt.S) -> functor (S : Mirage_stack_lwt.V4) -> sig ... end