- Exported `Fetcher` interface - Inject `Fetcher` to publicip loop and updaters - Get public IP and information at the same time - Only query ipinfo.io - Make `MultiInfo` part of the `Fetch` object
34 lines
878 B
Go
34 lines
878 B
Go
package privado
|
|
|
|
import (
|
|
"math/rand"
|
|
|
|
"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,
|
|
ipFetcher common.IPFetcher, unzipper common.Unzipper,
|
|
updaterWarner common.Warner,
|
|
parallelResolver common.ParallelResolver) *Provider {
|
|
return &Provider{
|
|
storage: storage,
|
|
randSource: randSource,
|
|
NoPortForwarder: utils.NewNoPortForwarding(providers.Privado),
|
|
Fetcher: updater.New(ipFetcher, unzipper, updaterWarner, parallelResolver),
|
|
}
|
|
}
|
|
|
|
func (p *Provider) Name() string {
|
|
return providers.Privado
|
|
}
|