package conduit
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=3a4684bb1485b1f247d6084dd0a356e1027e92c2cd467b35cabd59a764423e79
sha512=9fdb07540ae495e820e454a81f333551c18d3207c974adf35719198b93ff3f3d368f6558af8a80b6bd2af720ec6cbd274e7eecb816ac87384bcf8ac0d87357d3
doc/conduit/Resolver/module-type-S/index.html
Module type Resolver.SSource
Module type for a resolver that can map URIs to concrete endpoints that stream connections can be established with.
Abstract type of the cooperative threading library used, normally defined via the IO module type
State handle for a running resolver
Abstract type for a service entry, which maps a URI scheme into a protocol handler and TCP port
A rewrite function resolves a service and a URI into a concrete endpoint.
f ++ g is the composition of the service functions f and g.
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.
The 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.
add_rewrite ~host f t will add to the t resolver the f rewrite rule for all the domain names that shortest-prefix match host
service t is the function which is called when trying to resolve a hostname with t.
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.