mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-07 04:20:12 +02:00
d5ef3de64c
- Parallel resolver to resolve multiple hosts - Repeat resolver to repeat resolution for a single host - Additional parameters for fault toleration - Do not update servers if e.g. > 10% DNS resolutions failed - resolver package in updater package
16 lines
293 B
Go
16 lines
293 B
Go
package resolver
|
|
|
|
import "net"
|
|
|
|
func uniqueIPsToSlice(uniqueIPs map[string]struct{}) (ips []net.IP) {
|
|
ips = make([]net.IP, 0, len(uniqueIPs))
|
|
for key := range uniqueIPs {
|
|
IP := net.ParseIP(key)
|
|
if IPv4 := IP.To4(); IPv4 != nil {
|
|
IP = IPv4
|
|
}
|
|
ips = append(ips, IP)
|
|
}
|
|
return ips
|
|
}
|