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
+16 -16
View File
@@ -5,8 +5,8 @@ import (
"testing"
"github.com/qdm12/gluetun/internal/configuration/settings"
"github.com/qdm12/gluetun/internal/constants/vpn"
"github.com/qdm12/gluetun/internal/models"
"github.com/qdm12/gluetun/pkg/updaters/constants"
"github.com/stretchr/testify/assert"
)
@@ -58,56 +58,56 @@ func Test_pickConnection(t *testing.T) {
},
"openvpn_cycles": {
connections: []models.Connection{
{Type: vpn.OpenVPN, Port: 1, Hostname: "one"},
{Type: vpn.OpenVPN, Port: 2, Hostname: "two"},
{Type: constants.OpenVPN, Port: 1, Hostname: "one"},
{Type: constants.OpenVPN, Port: 2, Hostname: "two"},
},
selection: settings.ServerSelection{VPN: vpn.OpenVPN},
selection: settings.ServerSelection{VPN: constants.OpenVPN},
connection1: models.Connection{
Type: vpn.OpenVPN, Port: 1,
Type: constants.OpenVPN, Port: 1,
Hostname: "one",
},
connection2: models.Connection{
Type: vpn.OpenVPN, Port: 2,
Type: constants.OpenVPN, Port: 2,
Hostname: "two",
},
},
"openvpn_endpoint_ip_overrides_cycle_pick": {
connections: []models.Connection{
{Type: vpn.OpenVPN, Hostname: "one", IP: netip.AddrFrom4([4]byte{1, 1, 1, 1})},
{Type: vpn.OpenVPN, Hostname: "two", IP: netip.AddrFrom4([4]byte{2, 2, 2, 2})},
{Type: constants.OpenVPN, Hostname: "one", IP: netip.AddrFrom4([4]byte{1, 1, 1, 1})},
{Type: constants.OpenVPN, Hostname: "two", IP: netip.AddrFrom4([4]byte{2, 2, 2, 2})},
},
selection: settings.ServerSelection{
VPN: vpn.OpenVPN,
VPN: constants.OpenVPN,
OpenVPN: settings.OpenVPNSelection{
EndpointIP: netip.AddrFrom4([4]byte{9, 9, 9, 9}),
},
},
connection1: models.Connection{
Type: vpn.OpenVPN, Hostname: "one",
Type: constants.OpenVPN, Hostname: "one",
IP: netip.AddrFrom4([4]byte{9, 9, 9, 9}),
},
connection2: models.Connection{
Type: vpn.OpenVPN, Hostname: "two",
Type: constants.OpenVPN, Hostname: "two",
IP: netip.AddrFrom4([4]byte{9, 9, 9, 9}),
},
},
"wireguard_endpoint_ip_picks_target": {
connections: []models.Connection{
{Type: vpn.Wireguard, Hostname: "one", IP: netip.AddrFrom4([4]byte{1, 1, 1, 1})},
{Type: vpn.Wireguard, Hostname: "two", IP: netip.AddrFrom4([4]byte{2, 2, 2, 2})},
{Type: constants.Wireguard, Hostname: "one", IP: netip.AddrFrom4([4]byte{1, 1, 1, 1})},
{Type: constants.Wireguard, Hostname: "two", IP: netip.AddrFrom4([4]byte{2, 2, 2, 2})},
},
selection: settings.ServerSelection{
VPN: vpn.Wireguard,
VPN: constants.Wireguard,
Wireguard: settings.WireguardSelection{
EndpointIP: netip.AddrFrom4([4]byte{2, 2, 2, 2}),
},
},
connection1: models.Connection{
Type: vpn.Wireguard, Hostname: "two",
Type: constants.Wireguard, Hostname: "two",
IP: netip.AddrFrom4([4]byte{2, 2, 2, 2}),
},
connection2: models.Connection{
Type: vpn.Wireguard, Hostname: "two",
Type: constants.Wireguard, Hostname: "two",
IP: netip.AddrFrom4([4]byte{2, 2, 2, 2}),
},
},