mirror of
https://github.com/qdm12/gluetun.git
synced 2026-07-24 11:26:25 +02:00
chore(updater): move updater packages to pkg/updaters/<name>
This commit is contained in:
@@ -4,9 +4,8 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/configuration/settings"
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/gluetun/internal/constants/vpn"
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/constants"
|
||||
)
|
||||
|
||||
// GetConnection gets the connection from the OpenVPN configuration file.
|
||||
@@ -14,9 +13,9 @@ func (p *Provider) GetConnection(selection settings.ServerSelection, _ bool) (
|
||||
connection models.Connection, err error,
|
||||
) {
|
||||
switch selection.VPN {
|
||||
case vpn.OpenVPN:
|
||||
case constants.OpenVPN:
|
||||
return getOpenVPNConnection(p.extractor, selection)
|
||||
case vpn.Wireguard, vpn.AmneziaWg:
|
||||
case constants.Wireguard, constants.AmneziaWg:
|
||||
return getWireguardConnection(selection), nil
|
||||
default:
|
||||
return connection, fmt.Errorf("VPN type not supported for custom provider: %s", selection.VPN)
|
||||
@@ -52,7 +51,7 @@ func getWireguardConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection,
|
||||
) {
|
||||
connection = models.Connection{
|
||||
Type: vpn.Wireguard,
|
||||
Type: constants.Wireguard,
|
||||
IP: selection.Wireguard.EndpointIP,
|
||||
Port: *selection.Wireguard.EndpointPort,
|
||||
Protocol: constants.UDP,
|
||||
|
||||
Reference in New Issue
Block a user