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
+11 -10
View File
@@ -4,16 +4,17 @@ import (
"testing"
"github.com/qdm12/gluetun/internal/constants/providers"
"github.com/qdm12/gluetun/internal/constants/vpn"
"github.com/qdm12/gluetun/pkg/updaters/constants"
"github.com/qdm12/gluetun/pkg/updaters/models"
"github.com/stretchr/testify/assert"
)
func Test_Servers_ToMarkdown(t *testing.T) {
func Test_serversToMarkdown(t *testing.T) {
t.Parallel()
testCases := map[string]struct {
provider string
servers Servers
servers models.Servers
formatted string
errMessage string
}{
@@ -23,8 +24,8 @@ func Test_Servers_ToMarkdown(t *testing.T) {
},
providers.Cyberghost: {
provider: providers.Cyberghost,
servers: Servers{
Servers: []Server{
servers: models.Servers{
Servers: []models.Server{
{Country: "a", UDP: true, Hostname: "xa"},
{Country: "b", TCP: true, Hostname: "xb"},
},
@@ -36,10 +37,10 @@ func Test_Servers_ToMarkdown(t *testing.T) {
},
providers.Fastestvpn: {
provider: providers.Fastestvpn,
servers: Servers{
Servers: []Server{
{Country: "a", Hostname: "xa", VPN: vpn.OpenVPN, TCP: true},
{Country: "b", Hostname: "xb", VPN: vpn.OpenVPN, UDP: true},
servers: models.Servers{
Servers: []models.Server{
{Country: "a", Hostname: "xa", VPN: constants.OpenVPN, TCP: true},
{Country: "b", Hostname: "xb", VPN: constants.OpenVPN, UDP: true},
},
},
formatted: "| Country | Hostname | VPN | TCP | UDP |\n" +
@@ -53,7 +54,7 @@ func Test_Servers_ToMarkdown(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
markdown, err := testCase.servers.toMarkdown(testCase.provider)
markdown, err := serversToMarkdown(testCase.servers, testCase.provider)
assert.Equal(t, testCase.formatted, markdown)
if testCase.errMessage != "" {