mirror of
https://github.com/qdm12/gluetun.git
synced 2026-06-18 01:14:10 +02:00
@@ -11,5 +11,5 @@ func (p *Provider) GetConnection(selection settings.ServerSelection, ipv6Support
|
||||
) {
|
||||
defaults := utils.NewConnectionDefaults(0, 1195, 0) //nolint:mnd
|
||||
return utils.GetConnection(p.Name(),
|
||||
p.storage, selection, defaults, ipv6Supported, p.randSource)
|
||||
p.storage, selection, defaults, ipv6Supported, p.connPicker)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package expressvpn
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"math/rand"
|
||||
"net/netip"
|
||||
"testing"
|
||||
|
||||
@@ -80,12 +79,11 @@ func Test_Provider_GetConnection(t *testing.T) {
|
||||
storage := common.NewMockStorage(ctrl)
|
||||
storage.EXPECT().FilterServers(provider, testCase.selection).
|
||||
Return(testCase.filteredServers, testCase.storageErr)
|
||||
randSource := rand.NewSource(0)
|
||||
|
||||
unzipper := (common.Unzipper)(nil)
|
||||
warner := (common.Warner)(nil)
|
||||
parallelResolver := (common.ParallelResolver)(nil)
|
||||
provider := New(storage, randSource, unzipper, warner, parallelResolver)
|
||||
provider := New(storage, unzipper, warner, parallelResolver)
|
||||
|
||||
if testCase.panicMessage != "" {
|
||||
assert.PanicsWithValue(t, testCase.panicMessage, func() {
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
package expressvpn
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
"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/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
storage common.Storage
|
||||
randSource rand.Source
|
||||
connPicker *utils.ConnectionPicker
|
||||
common.Fetcher
|
||||
}
|
||||
|
||||
func New(storage common.Storage, randSource rand.Source,
|
||||
unzipper common.Unzipper, updaterWarner common.Warner,
|
||||
func New(storage common.Storage, unzipper common.Unzipper, updaterWarner common.Warner,
|
||||
parallelResolver common.ParallelResolver,
|
||||
) *Provider {
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
connPicker: utils.NewConnectionPicker(),
|
||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user