feat: accept array of upstreams in [[forwarding]]

Mirrors `[upstream] address` — `upstream` accepts string or array
of strings, builds an `UpstreamPool` and routes queries through
`forward_with_failover_raw` so SRTT ordering and failover apply to
matched `[[forwarding]]` rules the same way they do for the default
pool.

Single-string rules keep their current behavior (one-element pool,
equivalent single-upstream path). Empty array errors at config load.

Addresses item 1 of issue #102. Plan: docs/102_item1.md.
This commit is contained in:
Razvan Dimescu
2026-04-15 04:03:38 +03:00
parent 120ba5200e
commit 9a0d586b13
6 changed files with 172 additions and 53 deletions

View File

@@ -118,7 +118,7 @@ fn build_dot_connector() -> Result<tokio_rustls::TlsConnector> {
)))
}
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct UpstreamPool {
primary: Vec<Upstream>,
fallback: Vec<Upstream>,