mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-07 20:40:13 +02:00
chore(updater): move updater packages to pkg/updaters/<name>
This commit is contained in:
@@ -5,8 +5,8 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/airvpn/updater"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/airvpn"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client),
|
||||
Fetcher: airvpn.New(client),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ var (
|
||||
|
||||
type Fetcher interface {
|
||||
FetchServers(ctx context.Context, minServers int) (servers []models.Server, err error)
|
||||
Version() uint16
|
||||
}
|
||||
|
||||
type ParallelResolver interface {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/cyberghost/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/cyberghost"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -20,7 +20,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(parallelResolver, updaterWarner),
|
||||
Fetcher: cyberghost.New(parallelResolver, updaterWarner),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/example/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/example"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -23,7 +23,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(updaterWarner, unzipper, client, parallelResolver),
|
||||
Fetcher: example.New(updaterWarner, unzipper, client, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/expressvpn/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/expressvpn"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||
Fetcher: expressvpn.New(unzipper, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/fastestvpn/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/fastestvpn"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -22,7 +22,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
||||
Fetcher: fastestvpn.New(client, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/giganews/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/giganews"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||
Fetcher: giganews.New(unzipper, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/hidemyass/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/hidemyass"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -22,7 +22,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
||||
Fetcher: hidemyass.New(client, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/ipvanish/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/ipvanish"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||
Fetcher: ipvanish.New(unzipper, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/ivpn/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/ivpn"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -22,7 +22,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
||||
Fetcher: ivpn.New(client, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/mullvad/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/mullvad"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client),
|
||||
Fetcher: mullvad.New(client),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/nordvpn/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/nordvpn"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client, updaterWarner),
|
||||
Fetcher: nordvpn.New(client, updaterWarner),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/perfectprivacy/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/perfectprivacy"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -20,7 +20,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(unzipper, updaterWarner),
|
||||
Fetcher: perfectprivacy.New(unzipper, updaterWarner),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"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/pkg/updaters/privado"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client, updaterWarner),
|
||||
Fetcher: privado.New(client, updaterWarner),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/privateinternetaccess/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/privateinternetaccess"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -30,7 +30,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
timeNow: timeNow,
|
||||
randSource: randSource,
|
||||
portForwardPath: jsonPortForwardPath,
|
||||
Fetcher: updater.New(client),
|
||||
Fetcher: privateinternetaccess.New(client),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/privatevpn/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/privatevpn"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||
Fetcher: privatevpn.New(unzipper, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/protonvpn/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/protonvpn"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -23,7 +23,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client, updaterWarner, email, password),
|
||||
Fetcher: protonvpn.New(client, updaterWarner, email, password),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/purevpn/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/purevpn"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(ipFetcher, unzipper, updaterWarner, parallelResolver),
|
||||
Fetcher: purevpn.New(ipFetcher, unzipper, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/slickvpn/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/slickvpn"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -22,7 +22,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
||||
Fetcher: slickvpn.New(client, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/surfshark/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/surfshark"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -22,7 +22,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client, unzipper, updaterWarner, parallelResolver),
|
||||
Fetcher: surfshark.New(client, unzipper, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package updater
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/updater/resolver"
|
||||
)
|
||||
|
||||
func parallelResolverSettings(hosts []string) (settings resolver.ParallelSettings) {
|
||||
const (
|
||||
maxFailRatio = 0.1
|
||||
maxDuration = 20 * time.Second
|
||||
betweenDuration = time.Second
|
||||
maxNoNew = 2
|
||||
maxFails = 2
|
||||
)
|
||||
return resolver.ParallelSettings{
|
||||
Hosts: hosts,
|
||||
MaxFailRatio: maxFailRatio,
|
||||
Repeat: resolver.RepeatSettings{
|
||||
MaxDuration: maxDuration,
|
||||
BetweenDuration: betweenDuration,
|
||||
MaxNoNew: maxNoNew,
|
||||
MaxFails: maxFails,
|
||||
SortIPs: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/torguard/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/torguard"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||
Fetcher: torguard.New(unzipper, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package updater
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/updater/resolver"
|
||||
)
|
||||
|
||||
func parallelResolverSettings(hosts []string) (settings resolver.ParallelSettings) {
|
||||
const (
|
||||
maxFailRatio = 0.1
|
||||
maxDuration = 20 * time.Second
|
||||
betweenDuration = time.Second
|
||||
maxNoNew = 2
|
||||
maxFails = 2
|
||||
)
|
||||
return resolver.ParallelSettings{
|
||||
Hosts: hosts,
|
||||
MaxFailRatio: maxFailRatio,
|
||||
Repeat: resolver.RepeatSettings{
|
||||
MaxDuration: maxDuration,
|
||||
BetweenDuration: betweenDuration,
|
||||
MaxNoNew: maxNoNew,
|
||||
MaxFails: maxFails,
|
||||
SortIPs: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package updater
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
)
|
||||
|
||||
type Updater struct {
|
||||
unzipper common.Unzipper
|
||||
parallelResolver common.ParallelResolver
|
||||
warner common.Warner
|
||||
}
|
||||
|
||||
func New(unzipper common.Unzipper, warner common.Warner,
|
||||
parallelResolver common.ParallelResolver,
|
||||
) *Updater {
|
||||
return &Updater{
|
||||
unzipper: unzipper,
|
||||
parallelResolver: parallelResolver,
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
@@ -25,3 +25,7 @@ func (n *NoFetcher) FetchServers(context.Context, int) (
|
||||
) {
|
||||
return nil, fmt.Errorf("%w: for %s", ErrFetcherNotSupported, n.providerName)
|
||||
}
|
||||
|
||||
func (n *NoFetcher) Version() uint16 {
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/vpnsecure/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/vpnsecure"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -22,7 +22,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
||||
Fetcher: vpnsecure.New(client, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package updater
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
)
|
||||
|
||||
type Updater struct {
|
||||
client *http.Client
|
||||
parallelResolver common.ParallelResolver
|
||||
warner common.Warner
|
||||
}
|
||||
|
||||
func New(client *http.Client, warner common.Warner,
|
||||
parallelResolver common.ParallelResolver,
|
||||
) *Updater {
|
||||
return &Updater{
|
||||
client: client,
|
||||
parallelResolver: parallelResolver,
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/vpnunlimited/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/vpnunlimited"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||
Fetcher: vpnunlimited.New(unzipper, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package updater
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/updater/resolver"
|
||||
)
|
||||
|
||||
func parallelResolverSettings(hosts []string) (settings resolver.ParallelSettings) {
|
||||
const (
|
||||
maxFailRatio = 0.1
|
||||
maxDuration = 20 * time.Second
|
||||
betweenDuration = time.Second
|
||||
maxNoNew = 2
|
||||
maxFails = 2
|
||||
)
|
||||
return resolver.ParallelSettings{
|
||||
Hosts: hosts,
|
||||
MaxFailRatio: maxFailRatio,
|
||||
Repeat: resolver.RepeatSettings{
|
||||
MaxDuration: maxDuration,
|
||||
BetweenDuration: betweenDuration,
|
||||
MaxNoNew: maxNoNew,
|
||||
MaxFails: maxFails,
|
||||
SortIPs: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package updater
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
)
|
||||
|
||||
type Updater struct {
|
||||
unzipper common.Unzipper
|
||||
parallelResolver common.ParallelResolver
|
||||
warner common.Warner
|
||||
}
|
||||
|
||||
func New(unzipper common.Unzipper, warner common.Warner,
|
||||
parallelResolver common.ParallelResolver,
|
||||
) *Updater {
|
||||
return &Updater{
|
||||
unzipper: unzipper,
|
||||
parallelResolver: parallelResolver,
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/vyprvpn/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/vyprvpn"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||
Fetcher: vyprvpn.New(unzipper, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package updater
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
)
|
||||
|
||||
type Updater struct {
|
||||
unzipper common.Unzipper
|
||||
parallelResolver common.ParallelResolver
|
||||
warner common.Warner
|
||||
}
|
||||
|
||||
func New(unzipper common.Unzipper, warner common.Warner,
|
||||
parallelResolver common.ParallelResolver,
|
||||
) *Updater {
|
||||
return &Updater{
|
||||
unzipper: unzipper,
|
||||
parallelResolver: parallelResolver,
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
"github.com/qdm12/gluetun/internal/provider/windscribe/updater"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/windscribe"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
@@ -21,7 +21,7 @@ func New(storage common.Storage, randSource rand.Source,
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
Fetcher: updater.New(client, updaterWarner),
|
||||
Fetcher: windscribe.New(client, updaterWarner),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package airvpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package airvpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package airvpn
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
@@ -13,3 +13,7 @@ func New(client *http.Client) *Updater {
|
||||
client: client,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 1
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package cyberghost
|
||||
|
||||
import "github.com/qdm12/gluetun/internal/constants"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package cyberghost
|
||||
|
||||
func mergeCountryCodes(base, extend map[string]string) (merged map[string]string) {
|
||||
merged = make(map[string]string, len(base))
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package cyberghost
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package cyberghost
|
||||
|
||||
import (
|
||||
"time"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package cyberghost
|
||||
|
||||
import (
|
||||
"context"
|
||||
+5
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package cyberghost
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
@@ -15,3 +15,7 @@ func New(parallelResolver common.ParallelResolver, warner common.Warner) *Update
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 5 //nolint:mnd
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package example
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package example
|
||||
|
||||
import (
|
||||
"time"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package example
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package example
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
@@ -25,3 +25,7 @@ func New(warner common.Warner, unzipper common.Unzipper,
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 1
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package expressvpn
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package expressvpn
|
||||
|
||||
import (
|
||||
"time"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package expressvpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -0,0 +1,25 @@
|
||||
package expressvpn
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
)
|
||||
|
||||
type Updater struct {
|
||||
unzipper common.Unzipper
|
||||
parallelResolver common.ParallelResolver
|
||||
warner common.Warner
|
||||
}
|
||||
|
||||
func New(unzipper common.Unzipper, warner common.Warner,
|
||||
parallelResolver common.ParallelResolver,
|
||||
) *Updater {
|
||||
return &Updater{
|
||||
unzipper: unzipper,
|
||||
parallelResolver: parallelResolver,
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 2 //nolint:mnd
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package fastestvpn
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package fastestvpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package fastestvpn
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package fastestvpn
|
||||
|
||||
import (
|
||||
"time"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package fastestvpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -0,0 +1,27 @@
|
||||
package fastestvpn
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
)
|
||||
|
||||
type Updater struct {
|
||||
client *http.Client
|
||||
parallelResolver common.ParallelResolver
|
||||
warner common.Warner
|
||||
}
|
||||
|
||||
func New(client *http.Client, warner common.Warner,
|
||||
parallelResolver common.ParallelResolver,
|
||||
) *Updater {
|
||||
return &Updater{
|
||||
client: client,
|
||||
parallelResolver: parallelResolver,
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 2 //nolint:mnd
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package giganews
|
||||
|
||||
import (
|
||||
"errors"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package giganews
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package giganews
|
||||
|
||||
import (
|
||||
"time"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package giganews
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package giganews
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
type Updater struct {
|
||||
unzipper common.Unzipper
|
||||
warner common.Warner
|
||||
parallelResolver common.ParallelResolver
|
||||
warner common.Warner
|
||||
}
|
||||
|
||||
func New(unzipper common.Unzipper, warner common.Warner,
|
||||
@@ -15,7 +15,11 @@ func New(unzipper common.Unzipper, warner common.Warner,
|
||||
) *Updater {
|
||||
return &Updater{
|
||||
unzipper: unzipper,
|
||||
warner: warner,
|
||||
parallelResolver: parallelResolver,
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 1
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package hidemyass
|
||||
|
||||
func getUniqueHosts(tcpHostToURL, udpHostToURL map[string]string) (
|
||||
hosts []string,
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package hidemyass
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package hidemyass
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package hidemyass
|
||||
|
||||
import (
|
||||
"time"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package hidemyass
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package hidemyass
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
@@ -21,3 +21,7 @@ func New(client *http.Client, warner common.Warner,
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 2 //nolint:mnd
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package hidemyass
|
||||
|
||||
import (
|
||||
"strings"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ipvanish
|
||||
|
||||
import (
|
||||
"errors"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ipvanish
|
||||
|
||||
import (
|
||||
"errors"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ipvanish
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ipvanish
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ipvanish
|
||||
|
||||
import (
|
||||
"time"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ipvanish
|
||||
|
||||
import (
|
||||
"context"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ipvanish
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ipvanish
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
type Updater struct {
|
||||
unzipper common.Unzipper
|
||||
parallelResolver common.ParallelResolver
|
||||
warner common.Warner
|
||||
parallelResolver common.ParallelResolver
|
||||
}
|
||||
|
||||
func New(unzipper common.Unzipper, warner common.Warner,
|
||||
@@ -15,7 +15,11 @@ func New(unzipper common.Unzipper, warner common.Warner,
|
||||
) *Updater {
|
||||
return &Updater{
|
||||
unzipper: unzipper,
|
||||
parallelResolver: parallelResolver,
|
||||
warner: warner,
|
||||
parallelResolver: parallelResolver,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 2 //nolint:mnd
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ivpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ivpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ivpn
|
||||
|
||||
import (
|
||||
"time"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ivpn
|
||||
|
||||
import "net/http"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ivpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ivpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package ivpn
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
@@ -21,3 +21,7 @@ func New(client *http.Client, warner common.Warner,
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 3 //nolint:mnd
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package mullvad
|
||||
|
||||
import (
|
||||
"context"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package mullvad
|
||||
|
||||
import (
|
||||
"errors"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package mullvad
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package mullvad
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package mullvad
|
||||
|
||||
import (
|
||||
"context"
|
||||
+5
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package mullvad
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
@@ -13,3 +13,7 @@ func New(client *http.Client) *Updater {
|
||||
client: client,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 4 //nolint:mnd
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package nordvpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package nordvpn
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package nordvpn
|
||||
|
||||
import (
|
||||
"errors"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package nordvpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package nordvpn
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
@@ -17,3 +17,7 @@ func New(client *http.Client, warner common.Warner) *Updater {
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 5 //nolint:mnd
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package perfectprivacy
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package perfectprivacy
|
||||
|
||||
import (
|
||||
"strings"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package perfectprivacy
|
||||
|
||||
import (
|
||||
"context"
|
||||
+5
-1
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package perfectprivacy
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/provider/common"
|
||||
@@ -15,3 +15,7 @@ func New(unzipper common.Unzipper, warner common.Warner) *Updater {
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 1
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package privado
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package updater
|
||||
package privado
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
@@ -17,3 +17,7 @@ func New(client *http.Client, warner common.Warner) *Updater {
|
||||
warner: warner,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Updater) Version() uint16 {
|
||||
return 6 //nolint:mnd
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user