Functions for interacting with DNS domain names.
This namespace represents domain names internally in a normalized byte-oriented form. The normalized form has these properties:
This form has these benefits:
The main disadvantage is that this form makes it more difficult to find the immediate parent of a given domain.
Functions for interacting with DNS domain names. This namespace represents domain names internally in a normalized byte-oriented form. The normalized form has these properties: - IDN labels use IDNA encoding. - Domain labels go from top-level to bottom-level. This is the reverse of the usual order. - A byte comes before each label. The byte gives the count of bytes in the label. This form has these benefits: - It can represent any binary data accurately, the same as the DNS wire form. - Lexicographic byte order is also hierarchical order. - For a given child domain and ancestor domain, you can find the next longer child of the ancestor. The main disadvantage is that this form makes it more difficult to find the immediate parent of a given domain.
(->domain dom)Coerce dom to a DNSDomain. Throws when it cannot interpret dom.
Coerce `dom` to a DNSDomain. Throws when it cannot interpret `dom`.
(->domain-set coll)Create a hierarchical set from the domains in coll.
Create a hierarchical set from the domains in `coll`.
(domain dom)Return the DNS domain for representation dom.
Return the DNS domain for representation `dom`.
(domain-ancestors child)(domain-ancestors child parent)Generate a seq of all the domains for which the domain child is a proper
subdomain. The seq starts with the domain after parent and ends with the
domain itself. Uses the implied empty root domain as parent if you do not
supply one.
Generate a seq of all the domains for which the domain `child` is a proper subdomain. The seq starts with the domain after `parent` and ends with the domain itself. Uses the implied empty root domain as `parent` if you do not supply one.
(domain-byte-seq dom)Return the internal normalized byte form of the domain dom as a
sequence of bytes.
Return the internal normalized byte form of the domain `dom` as a sequence of bytes.
(domain-compare left right)(domain-compare stable left right)Compare two domains. The result semantics are the same as compare. When
stable is true (the default), the result is 0 only when the domains are
value-identical. When stable is false, the result is 0 when the domains are
identical up to their minimum common full-label length. Domain comparison
always ignores case.
Compare two domains. The result semantics are the same as `compare`. When `stable` is true (the default), the result is 0 only when the domains are value-identical. When `stable` is false, the result is 0 when the domains are identical up to their minimum common full-label length. Domain comparison always ignores case.
(domain-contains? parent child)Determine if the domain child is a subdomain of or identical to the domain
parent.
Determine if the domain `child` is a subdomain of or identical to the domain `parent`.
(domain-hostname? dom)(domain-hostname? dom underscores)Determine if the domain dom is a valid hostname. Let hostnames contain
underscores if underscores is true (default false).
Determine if the domain `dom` is a valid hostname. Let hostnames contain underscores if `underscores` is true (default false).
(domain-labels dom)Seq of labels in the domain dom.
Seq of labels in the domain `dom`.
(domain-next child)(domain-next child parent)For the domain child which is a subdomain of the domain parent, return
the immediate child domain of parent. This domain is identical to child,
or it is a parent domain of child. Returns nil if there is no such domain.
Uses the implied empty root domain as parent if you do not supply one.
For the domain `child` which is a subdomain of the domain `parent`, return the immediate child domain of `parent`. This domain is identical to `child`, or it is a parent domain of `child`. Returns `nil` if there is no such domain. Uses the implied empty root domain as `parent` if you do not supply one.
(domain-parent dom)Return the domain of which dom is an immediate subdomain.
Return the domain of which `dom` is an immediate subdomain.
(domain-set & doms)Create a hierarchical set from domains doms.
Create a hierarchical set from domains `doms`.
(domain-subdomain? parent child)Determine if child is a subdomain of parent.
Determine if `child` is a subdomain of `parent`.
(domain? dom)Determine if dom represents a DNS domain.
Determine if `dom` represents a DNS domain.
(idn-str dom)Convert dom to IDN string form. Interpret Punycode.
Convert `dom` to IDN string form. Interpret Punycode.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |