mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-07 04:20:12 +02:00
@@ -13,5 +13,5 @@ func (p *Provider) GetConnection(selection settings.ServerSelection, ipv6Support
|
||||
// combination. If one combination is not supported, set it to `0`.
|
||||
defaults := utils.NewConnectionDefaults(443, 1194, 51820) //nolint:mnd
|
||||
return utils.GetConnection(p.Name(),
|
||||
p.storage, selection, defaults, ipv6Supported, p.randSource)
|
||||
p.storage, selection, defaults, ipv6Supported, p.connPicker)
|
||||
}
|
||||
|
||||
@@ -1,28 +1,27 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"net/http"
|
||||
|
||||
"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/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
storage common.Storage
|
||||
randSource rand.Source
|
||||
connPicker *utils.ConnectionPicker
|
||||
common.Fetcher
|
||||
}
|
||||
|
||||
// TODO: remove unneeded arguments once the updater is implemented.
|
||||
func New(storage common.Storage, randSource rand.Source,
|
||||
updaterWarner common.Warner, client *http.Client,
|
||||
func New(storage common.Storage, updaterWarner common.Warner, client *http.Client,
|
||||
unzipper common.Unzipper, parallelResolver common.ParallelResolver,
|
||||
) *Provider {
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
connPicker: utils.NewConnectionPicker(),
|
||||
Fetcher: updater.New(updaterWarner, unzipper, client, parallelResolver),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user