DVHosts class final

Every host an application answers on.

Empty means dartvel.hosts was not declared, and then nothing anywhere behaves differently: every function here is only consulted when isEmpty is false.

Constructors

DVHosts(List<DVHostEntry> entries, {List<DVHostRedirect> redirectHosts = const <DVHostRedirect>[]})
const

Properties

entries → List<DVHostEntry>
final
hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
no setter
isNotEmpty → bool
no setter
primary → DVHostEntry
The entry with no mount. parse refuses a configuration without exactly one, so a DVHosts that is not empty always has it.
no setter
primaryMatch → DVHostMatch
The primary host as a match.
no setter
redirectHosts → List<DVHostRedirect>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

linkFrom(DVHostMatch from, String location) → String
Where a link to the internal location (a path, with any query and fragment) points when it is followed on from: a path on that host, its mount stripped, when it owns the route; the route's public URL on the host that does otherwise.
match(String host) → DVHostMatch?
The entry for host, exact names before wildcards, or null for a host nothing declares. host is normalised first (case, port, trailing dot).
matchOrPrimary(String? host) → DVHostMatch
match, or the primary host: an unknown host -- a health check, a bare IP -- is served as the primary.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
owner(String internalPath) → DVHostMatch
The host that owns internalPath: the entry with the longest mount containing it, the primary host when none does.
ownerOfPattern(String pattern) → DVHostEntry?
The entry that owns a route pattern such as /apps/:id, a parameter segment standing for any label. Null when there are no hosts.
publicUrl(String internalPath, {String? query}) → String
internalPath as an absolute URL on the host that owns it, with query when there is one. The root of a host is written as its origin with no trailing slash, as every canonical and sitemap URL Dartvel writes is; with a query it is origin/?query.
redirectsToJson() → List<Object?>
The redirecting hosts, for the manifest's hostRedirects.
sitemapHostOf(DVHostMatch host) → DVHostMatch
The host whose sitemap lists the pages of host: host itself unless it matched a wildcard, and for a wildcard host the declared (non-wildcard) host with the longest mount containing its mount, the primary when none does. A wildcard is an open-ended family of hosts nobody can submit one by one, so the host above it enumerates them; each still has a sitemap of its own, and its robots.txt names both (sitemaps.org cross-submission).
toJson() → List<Object?>
The list the manifest carries.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromJson(Object? json) → DVHosts
What toJson wrote; empty for anything else.
parse(Object? yaml, {String? defaultSiteUrl}) → DVHostsParse
Reads dartvel.hosts. defaultSiteUrl is dartvel.seo.siteUrl, which the primary host's siteUrl defaults to.

Constants

none → const DVHosts