chore(updater): move updater packages to pkg/updaters/<name>

This commit is contained in:
Quentin McGaw
2026-04-23 03:47:57 +00:00
parent 5b01324d5f
commit 13503b0ae0
268 changed files with 1602 additions and 1026 deletions
+4 -5
View File
@@ -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,