chore(provider): use type assertion for port forwarders

This commit is contained in:
Quentin McGaw
2023-09-23 13:02:09 +00:00
parent 84300db7c1
commit aa6dc786a4
29 changed files with 129 additions and 185 deletions

View File

@@ -7,23 +7,20 @@ 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/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) *Provider {
return &Provider{
storage: storage,
randSource: randSource,
NoPortForwarder: utils.NewNoPortForwarding(providers.Mullvad),
Fetcher: updater.New(client),
storage: storage,
randSource: randSource,
Fetcher: updater.New(client),
}
}