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)
| 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. |
| 38 | func 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 | |
| 46 | func makeForEachAddr(host string, makeProbes func(netip.Addr) []*Probe, opts ForEachAddrOpts) *forEachAddrProbe { |
| 47 | if opts.Logf == nil { |
searching dependent graphs…