chore(all): move sub-packages to internal/provider

This commit is contained in:
Quentin McGaw
2022-05-27 17:48:51 +00:00
parent 364f9de756
commit 42904b6749
118 changed files with 25 additions and 25 deletions

View File

@@ -0,0 +1,30 @@
package fastestvpn
import (
"context"
"net"
"time"
"github.com/qdm12/gluetun/internal/updater/resolver"
)
func resolveHosts(ctx context.Context, presolver resolver.Parallel,
hosts []string, minServers int) (hostToIPs map[string][]net.IP,
warnings []string, err error) {
const (
maxFailRatio = 0.1
maxNoNew = 1
maxFails = 2
)
settings := resolver.ParallelSettings{
MaxFailRatio: maxFailRatio,
MinFound: minServers,
Repeat: resolver.RepeatSettings{
MaxDuration: time.Second,
MaxNoNew: maxNoNew,
MaxFails: maxFails,
SortIPs: true,
},
}
return presolver.Resolve(ctx, hosts, settings)
}