chore(internal/provider): rename all structs to Provider
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (c *Cyberghost) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(443, 443, 0) //nolint:gomnd
|
||||
return utils.GetConnection(c.servers, selection, defaults, c.randSource)
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (c *Cyberghost) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
//nolint:gomnd
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Cyberghost struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Cyberghost {
|
||||
return &Cyberghost{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Cyberghost),
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (f *Fastestvpn) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(4443, 4443, 0) //nolint:gomnd
|
||||
return utils.GetConnection(f.servers, selection, defaults, f.randSource)
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (f *Fastestvpn) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
//nolint:gomnd
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Fastestvpn struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Fastestvpn {
|
||||
return &Fastestvpn{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Fastestvpn),
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (h *HideMyAss) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(8080, 553, 0) //nolint:gomnd
|
||||
return utils.GetConnection(h.servers, selection, defaults, h.randSource)
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (h *HideMyAss) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
//nolint:gomnd
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type HideMyAss struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *HideMyAss {
|
||||
return &HideMyAss{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.HideMyAss),
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (i *Ipvanish) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(0, 443, 0) //nolint:gomnd
|
||||
return utils.GetConnection(i.servers, selection, defaults, i.randSource)
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (i *Ipvanish) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
AuthUserPass: true,
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Ipvanish struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Ipvanish {
|
||||
return &Ipvanish{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Ipvanish),
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (i *Ivpn) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(443, 1194, 58237) //nolint:gomnd
|
||||
return utils.GetConnection(i.servers, selection, defaults, i.randSource)
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (i *Ivpn) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
//nolint:gomnd
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Ivpn struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Ivpn {
|
||||
return &Ivpn{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Ivpn),
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (m *Mullvad) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(443, 1194, 51820) //nolint:gomnd
|
||||
return utils.GetConnection(m.servers, selection, defaults, m.randSource)
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (m *Mullvad) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
//nolint:gomnd
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Mullvad struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Mullvad {
|
||||
return &Mullvad{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Mullvad),
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (n *Nordvpn) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(443, 1194, 0) //nolint:gomnd
|
||||
return utils.GetConnection(n.servers, selection, defaults, n.randSource)
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (n *Nordvpn) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
//nolint:gomnd
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Nordvpn struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Nordvpn {
|
||||
return &Nordvpn{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Nordvpn),
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Perfectprivacy) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(443, 443, 0) //nolint:gomnd
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Perfectprivacy) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
//nolint:gomnd
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Perfectprivacy struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Perfectprivacy {
|
||||
return &Perfectprivacy{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Perfectprivacy),
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Privado) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(0, 1194, 0) //nolint:gomnd
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Privado) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
//nolint:gomnd
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Privado struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Privado {
|
||||
return &Privado{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Privado),
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *PIA) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
// Set port defaults depending on encryption preset.
|
||||
var defaults utils.ConnectionDefaults
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *PIA) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
RemoteCertTLS: true,
|
||||
|
||||
@@ -26,7 +26,7 @@ var (
|
||||
)
|
||||
|
||||
// PortForward obtains a VPN server side port forwarded from PIA.
|
||||
func (p *PIA) PortForward(ctx context.Context, client *http.Client,
|
||||
func (p *Provider) PortForward(ctx context.Context, client *http.Client,
|
||||
logger utils.Logger, gateway net.IP, serverName string) (
|
||||
port uint16, err error) {
|
||||
var server models.Server
|
||||
@@ -90,7 +90,7 @@ var (
|
||||
ErrPortForwardedExpired = errors.New("port forwarded data expired")
|
||||
)
|
||||
|
||||
func (p *PIA) KeepPortForward(ctx context.Context, client *http.Client,
|
||||
func (p *Provider) KeepPortForward(ctx context.Context, client *http.Client,
|
||||
port uint16, gateway net.IP, serverName string) (err error) {
|
||||
privateIPClient := newHTTPClient(serverName)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
type PIA struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
timeNow func() time.Time
|
||||
@@ -18,9 +18,9 @@ type PIA struct {
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source,
|
||||
timeNow func() time.Time) *PIA {
|
||||
timeNow func() time.Time) *Provider {
|
||||
const jsonPortForwardPath = "/gluetun/piaportforward.json"
|
||||
return &PIA{
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
timeNow: timeNow,
|
||||
randSource: randSource,
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Privatevpn) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(443, 1194, 0) //nolint:gomnd
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Privatevpn) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
RemoteCertTLS: true,
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Privatevpn struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Privatevpn {
|
||||
return &Privatevpn{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Privatevpn),
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Protonvpn) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(443, 1194, 0) //nolint:gomnd
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Protonvpn) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
//nolint:gomnd
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Protonvpn struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Protonvpn {
|
||||
return &Protonvpn{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Protonvpn),
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Purevpn) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(80, 53, 0) //nolint:gomnd
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Purevpn) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
RemoteCertTLS: true,
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Purevpn struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Purevpn {
|
||||
return &Purevpn{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Purevpn),
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (s *Surfshark) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(1443, 1194, 0) //nolint:gomnd
|
||||
return utils.GetConnection(s.servers, selection, defaults, s.randSource)
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (s *Surfshark) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
//nolint:gomnd
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Surfshark struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Surfshark {
|
||||
return &Surfshark{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Surfshark),
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Torguard) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(1912, 1912, 0) //nolint:gomnd
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (t *Torguard) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
RemoteCertTLS: true,
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Torguard struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Torguard {
|
||||
return &Torguard{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Torguard),
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (v *Vyprvpn) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(0, 443, 0) //nolint:gomnd
|
||||
return utils.GetConnection(v.servers, selection, defaults, v.randSource)
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (v *Vyprvpn) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
//nolint:gomnd
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Vyprvpn struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Vyprvpn {
|
||||
return &Vyprvpn{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Vyprvpn),
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (w *Wevpn) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(1195, 1194, 0) //nolint:gomnd
|
||||
return utils.GetConnection(w.servers, selection, defaults, w.randSource)
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (w *Wevpn) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
RemoteCertTLS: true,
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Wevpn struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Wevpn {
|
||||
return &Wevpn{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Wevpn),
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *Windscribe) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
defaults := utils.NewConnectionDefaults(443, 1194, 1194) //nolint:gomnd
|
||||
return utils.GetConnection(p.servers, selection, defaults, p.randSource)
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (w *Windscribe) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
RemoteCertTLS: true,
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Windscribe struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source) *Windscribe {
|
||||
return &Windscribe{
|
||||
func New(servers []models.Server, randSource rand.Source) *Provider {
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Windscribe),
|
||||
|
||||
Reference in New Issue
Block a user