MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / resolve

Method resolve

src/storage-operators/src/oneshot_source/http_source.rs:40–54  ·  view source on GitHub ↗
(&self, name: Name)

Source from the content-addressed store, hash-verified

38
39impl Resolve for MzHttpResolver {
40 fn resolve(&self, name: Name) -> Resolving {
41 let enforce = self.enforce_external_addresses;
42 Box::pin(async move {
43 let ips = mz_ore::netio::resolve_address(name.as_str(), enforce).await?;
44 // reqwest substitutes the conventional port (80/443) when the
45 // SocketAddr's port is 0 and no explicit port was given in the URL.
46 let addrs: Addrs = Box::new(
47 ips.into_iter()
48 .map(|ip| SocketAddr::new(ip, 0))
49 .collect::<Vec<_>>()
50 .into_iter(),
51 );
52 Ok(addrs)
53 })
54 }
55}
56
57/// Build a reqwest [`Client`] for fetching `COPY FROM` URLs. This uses

Callers

nothing calls this directly

Calls 4

resolve_addressFunction · 0.85
as_strMethod · 0.45
into_iterMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected