To focus the search input from anywhere on the page, press the 'S' key.
in-package search v0.1.0
Provides a DNS-enabled
Resolver_lwt given a network stack. See
module T : Mirage_types_lwt.TIME
module S : Mirage_types_lwt.STACKV4
include Resolver_lwt.S with type t = Resolver_lwt.t
type 'a io = 'a Lwt.t
Abstract type of the cooperative threading library used, normally defined via the
IO module type
type t = Resolver_lwt.t
State handle for a running resolver
type svc = Resolver.service
Abstract type for a service entry, which maps a URI scheme into a protocol handler and TCP port
val sexp_of_svc : svc -> Ppx_sexp_conv_lib.Sexp.t
val svc_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> svc
type rewrite_fn = svc -> Uri.t -> Conduit.endp io
A rewrite function resolves a service and a URI into a concrete endpoint.
val (++) : service_fn -> service_fn -> service_fn
f ++ g is the composition of the service functions
val init : ?service:service_fn -> ?rewrites:(string * rewrite_fn) list -> unit -> t
init ?service ?rewrites will initialize the resolver and return a state handler. The service argument should contain the system-specific resolution mechanism for URI schemas.
rewrites argument can optionally override a subset of the URI domain name with the given
rewrite_fn to permit custom resolution rules. For example, a rewrite rule for ".xen" would let the rewrite function resolve hostnames such as "foo.xen" into a shared memory channel for the "foo" virtual machine.
val add_rewrite : host:string -> f:rewrite_fn -> t -> unit
add_rewrite ~host f t will add to the
t resolver the
f rewrite rule for all the domain names that shortest-prefix match
val set_service : f:service_fn -> t -> unit
val service : t -> service_fn
service t is the function which is called when trying to resolve a hostname with
val resolve_uri : ?rewrites:(string * rewrite_fn) list -> uri:Uri.t -> t -> Conduit.endp io
resolve_uri ?rewrites ~uri t will use
t to resolve the
uri into a concrete endpoint. Any
rewrites that are passed in will be overlayed on the existing rules within the
t resolver, but not otherwise modify it.