chore(resolver): export structs instead of interfaces

This commit is contained in:
Quentin McGaw
2022-06-09 03:10:56 +00:00
parent 415cb7a945
commit 899f10c35e
37 changed files with 114 additions and 130 deletions

View File

@@ -6,7 +6,7 @@ import (
"github.com/qdm12/gluetun/internal/updater/resolver"
)
func newParallelResolver() (parallelResolver resolver.Parallel) {
func newParallelResolver() (parallelResolver *resolver.Parallel) {
const (
maxFailRatio = 0.1
maxDuration = 20 * time.Second

View File

@@ -12,7 +12,7 @@ import (
"github.com/golang/mock/gomock"
"github.com/qdm12/gluetun/internal/constants/vpn"
"github.com/qdm12/gluetun/internal/models"
"github.com/qdm12/gluetun/internal/updater/resolver/mock_resolver"
"github.com/qdm12/gluetun/internal/provider/common"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -128,7 +128,7 @@ func Test_Updater_GetServers(t *testing.T) {
}),
}
presolver := mock_resolver.NewMockParallel(ctrl)
presolver := common.NewMockParallelResolver(ctrl)
if testCase.expectResolve {
presolver.EXPECT().Resolve(ctx, testCase.hostsToResolve, testCase.minServers).
Return(testCase.hostToIPs, testCase.resolveWarnings, testCase.resolveErr)

View File

@@ -3,12 +3,12 @@ package ivpn
import (
"net/http"
"github.com/qdm12/gluetun/internal/updater/resolver"
"github.com/qdm12/gluetun/internal/provider/common"
)
type Updater struct {
client *http.Client
presolver resolver.Parallel
presolver common.ParallelResolver
warner Warner
}