MCPcopy Index your code
hub / github.com/tailscale/tailscale / ForEachAddr

Function ForEachAddr

prober/dns.go:38–44  ·  view source on GitHub ↗

ForEachAddr returns a Probe that resolves a given hostname into all available IP addresses, and then calls a function to create new Probes every time a new IP is discovered. The Probes returned will be closed if an IP address is no longer in the DNS record for the given hostname. This can be used to

(host string, makeProbes func(netip.Addr) []*Probe, opts ForEachAddrOpts)

Source from the content-addressed store, hash-verified

36// IP address is no longer in the DNS record for the given hostname. This can
37// be used to healthcheck every IP address that a hostname resolves to.
38func ForEachAddr(host string, makeProbes func(netip.Addr) []*Probe, opts ForEachAddrOpts) ProbeClass {
39 feap := makeForEachAddr(host, makeProbes, opts)
40 return ProbeClass{
41 Probe: feap.run,
42 Class: "dns_each_addr",
43 }
44}
45
46func makeForEachAddr(host string, makeProbes func(netip.Addr) []*Probe, opts ForEachAddrOpts) *forEachAddrProbe {
47 if opts.Logf == nil {

Callers 1

ExampleForEachAddrFunction · 0.92

Calls 1

makeForEachAddrFunction · 0.85

Tested by 1

ExampleForEachAddrFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…