pub struct DnsDiscovery {
pub hostname: String,
pub port: u16,
pub refresh_interval_s: u64,
pub record_type: String,
pub fail_open: bool,
pub min_endpoints: u32,
}Expand description
DNS-based dynamic upstream discovery (DW-042): when present on an
upstream, a background discovery task resolves hostname via DNS,
watches the record TTL, and re-resolves when the TTL expires (or at
refresh_interval_s, whichever comes first), updating the upstream’s
endpoint set live — without a restart. The endpoints field becomes
the INITIAL/fallback set: used until the first resolution completes
and as a fallback when DNS fails and fail_open is true. When
absent, endpoints remain static (the current behavior — no change).
Only A and SRV records are supported. A records pair each resolved
address with port; SRV records carry their own port. Consul watch
and Kubernetes EndpointSlice watch are deferred to a future
milestone — DNS is the first discovery source.
Fields§
§hostname: StringThe DNS hostname to resolve (e.g. my-service.example.com).
port: u16The port to pair with each resolved A-record address. Ignored for SRV records (they carry their own port).
refresh_interval_s: u64How often to re-resolve, in seconds (default 30; bounded to
1..=3600). The actual refresh interval is
min(refresh_interval_s, record_ttl) so a short-TTL record is
refreshed sooner.
record_type: StringDNS record type: "A" (default) or "SRV".
fail_open: boolIf true (default), keep the last resolved endpoint set when DNS fails. If false, clear endpoints on failure (the upstream answers 503 until DNS recovers).
min_endpoints: u32Minimum endpoints to keep serving (default 1). If a resolution yields fewer than this, the previous set is kept (the upstream does not shrink below the floor).
Trait Implementations§
Source§impl Clone for DnsDiscovery
impl Clone for DnsDiscovery
Source§fn clone(&self) -> DnsDiscovery
fn clone(&self) -> DnsDiscovery
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DnsDiscovery
impl Debug for DnsDiscovery
Source§impl<'de> Deserialize<'de> for DnsDiscovery
impl<'de> Deserialize<'de> for DnsDiscovery
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for DnsDiscovery
impl JsonSchema for DnsDiscovery
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for DnsDiscovery
impl PartialEq for DnsDiscovery
Source§impl Serialize for DnsDiscovery
impl Serialize for DnsDiscovery
impl StructuralPartialEq for DnsDiscovery
Auto Trait Implementations§
impl Freeze for DnsDiscovery
impl RefUnwindSafe for DnsDiscovery
impl Send for DnsDiscovery
impl Sync for DnsDiscovery
impl Unpin for DnsDiscovery
impl UnwindSafe for DnsDiscovery
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more