pub struct Resolver(/* private fields */);dns only.Expand description
Query the Fly.io internal DNS records.
Implementations§
source§impl Resolver
impl Resolver
sourcepub fn new() -> Result<Self, Error>
Available on crate features detect or environment only.
pub fn new() -> Result<Self, Error>
detect or environment only.Create a Resolver which configures itself based on the host’s
detected Fly.io private network address.
If the host does not appear to be running under Fly.io or connected to
the Wireguard VPN, an Unavailable error will be returned.
sourcepub fn with_source(source: SocketAddr, local: Option<SocketAddr>) -> Self
pub fn with_source(source: SocketAddr, local: Option<SocketAddr>) -> Self
Create a Resolver which will send DNS queries to the given source
server to determine your Fly.io application topology.
If local is specified, sockets used to send DNS queries will be bound
to the given address.
sourcepub fn with_sources(
sources: impl IntoIterator<Item = SocketAddr>,
local: Option<SocketAddr>
) -> Self
pub fn with_sources( sources: impl IntoIterator<Item = SocketAddr>, local: Option<SocketAddr> ) -> Self
Create a Resolver which will send DNS queries to the given sources
to determine your Fly.io application topology.
To set sources automatically based on the operating systems’ DNS
resolution configuration, see Resolver::system.
If local is specified, sockets used to send DNS queries will be bound
to the given address.
sourcepub fn system() -> Result<Self, Error>
Available on crate feature system-resolver only.
pub fn system() -> Result<Self, Error>
system-resolver only.Create a Resolver which will send DNS queries to the nameservers
configured in the host operating system (i.e., in /etc/resolv.conf).
sourcepub fn app(&self, name: impl Into<String>) -> AppResolver<'_>
pub fn app(&self, name: impl Into<String>) -> AppResolver<'_>
Create an AppResolver for querying the named app.
sourcepub fn current(&self) -> Result<AppResolver<'_>, Error>
Available on crate feature environment only.
pub fn current(&self) -> Result<AppResolver<'_>, Error>
environment only.Create an AppResolver for querying the running app (as set by $FLY_APP_NAME).
If $FLY_APP_NAME is unset, an Unavailable error is returned.
sourcepub async fn apps(&self) -> Result<Vec<String>, Error>
pub async fn apps(&self) -> Result<Vec<String>, Error>
Find all apps in the current Fly.io organization.