URI.Extra.MultiHostPortPair
- Package
- purescript-uri
- Repository
- slamdata/purescript-uri
#MultiHostPortPair Source
type MultiHostPortPair host port = Array (These host port)
Multi-host/port pairs, where host & port combinations can be separated by
,
, as used by some connection URI schemes. This is not strictly
compatible with RFC 3986, as in that spec RegName
s can contain ,
, and
only one port can be specified in the authority.
A motivating example for where this may be useful: dealing with mongodb connection strings.
#parser Source
parser :: forall port host. (Host -> Either URIPartParseError host) -> (Port -> Either URIPartParseError port) -> Parser String (MultiHostPortPair host port)
A parser for multiple host/port pairs embedded in a URI.
This function allows for the Host
and Port
components to be parsed into
custom representations. If this is not necessary, use pure
for both of
these arguments.
#print Source
print :: forall port host. (host -> Host) -> (port -> Port) -> MultiHostPortPair host port -> String
A printer for multiple host/port pairs embedded in a URI.
As a counterpart to the parser
this function also requires the Host
and Port
components to be printed back from their custom representations.
If no custom types are being used, pass id
for both of these arguments.
- Modules
- URI
- URI.
AbsoluteURI - URI.
Authority - URI.
Common - URI.
Extra. MultiHostPortPair - URI.
Extra. QueryPairs - URI.
Extra. UserPassInfo - URI.
Fragment - URI.
HierarchicalPart - URI.
Host - URI.
Host. Gen - URI.
Host. IPv4Address - URI.
Host. IPv6Address - URI.
Host. RegName - URI.
HostPortPair - URI.
HostPortPair. Gen - URI.
Path - URI.
Path. Absolute - URI.
Path. NoScheme - URI.
Path. Rootless - URI.
Path. Segment - URI.
Port - URI.
Port. Gen - URI.
Query - URI.
RelativePart - URI.
RelativeRef - URI.
Scheme - URI.
Scheme. Common - URI.
URI - URI.
URIRef - URI.
UserInfo