- Fix CLI operation not setting DNS server - Fix periodic operation not setting DNS server - Set DNS address for resolution once at start for both CLI and periodic operation - Inject resolver to each provider instead of creating it within - Use resolver settings on every call to `.Resolve` method, instead of passing it to constructor - Move out minServers check from resolver
35 lines
880 B
Go
35 lines
880 B
Go
package privado
|
|
|
|
import (
|
|
"math/rand"
|
|
"net/http"
|
|
|
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
|
"github.com/qdm12/gluetun/internal/provider/common"
|
|
"github.com/qdm12/gluetun/internal/provider/privado/updater"
|
|
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
)
|
|
|
|
type Provider struct {
|
|
storage common.Storage
|
|
randSource rand.Source
|
|
utils.NoPortForwarder
|
|
common.Fetcher
|
|
}
|
|
|
|
func New(storage common.Storage, randSource rand.Source,
|
|
client *http.Client, unzipper common.Unzipper,
|
|
updaterWarner common.Warner,
|
|
parallelResolver common.ParallelResolver) *Provider {
|
|
return &Provider{
|
|
storage: storage,
|
|
randSource: randSource,
|
|
NoPortForwarder: utils.NewNoPortForwarding(providers.Privado),
|
|
Fetcher: updater.New(client, unzipper, updaterWarner, parallelResolver),
|
|
}
|
|
}
|
|
|
|
func (p *Provider) Name() string {
|
|
return providers.Privado
|
|
}
|