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
@@ -6,6 +6,7 @@ import (
"testing"
"github.com/qdm12/gluetun/internal/constants/providers"
"github.com/qdm12/gluetun/pkg/updaters/models"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -20,18 +21,18 @@ func Test_AllServers_MarshalJSON(t *testing.T) {
}{
"no provider": {
allServers: &AllServers{
ProviderToServers: map[string]Servers{},
ProviderToServers: map[string]models.Servers{},
},
dataString: `{"version":0}`,
},
"two providers": {
allServers: &AllServers{
Version: 1,
ProviderToServers: map[string]Servers{
ProviderToServers: map[string]models.Servers{
providers.Cyberghost: {
Version: 1,
Timestamp: 1000,
Servers: []Server{
Servers: []models.Server{
{Country: "A"},
{Country: "B"},
},
@@ -39,7 +40,7 @@ func Test_AllServers_MarshalJSON(t *testing.T) {
providers.Privado: {
Version: 2,
Timestamp: 2000,
Servers: []Server{
Servers: []models.Server{
{City: "C"},
{City: "D"},
},
@@ -100,11 +101,11 @@ func Test_AllServers_UnmarshalJSON(t *testing.T) {
`"privado":{"version":2,"timestamp":2000,"servers":[{"city":"C"},{"city":"D"}]}}`,
allServers: AllServers{
Version: 1,
ProviderToServers: map[string]Servers{
ProviderToServers: map[string]models.Servers{
providers.Cyberghost: {
Version: 1,
Timestamp: 1000,
Servers: []Server{
Servers: []models.Server{
{Country: "A"},
{Country: "B"},
},
@@ -112,7 +113,7 @@ func Test_AllServers_UnmarshalJSON(t *testing.T) {
providers.Privado: {
Version: 2,
Timestamp: 2000,
Servers: []Server{
Servers: []models.Server{
{City: "C"},
{City: "D"},
},
@@ -146,11 +147,11 @@ func Test_AllServers_JSON_Marshal_Unmarshal(t *testing.T) {
allServers := &AllServers{
Version: 1,
ProviderToServers: map[string]Servers{
ProviderToServers: map[string]models.Servers{
providers.Cyberghost: {
Version: 1,
Timestamp: 1000,
Servers: []Server{
Servers: []models.Server{
{Country: "A"},
{Country: "B"},
},
@@ -158,7 +159,7 @@ func Test_AllServers_JSON_Marshal_Unmarshal(t *testing.T) {
providers.Privado: {
Version: 2,
Timestamp: 2000,
Servers: []Server{
Servers: []models.Server{
{City: "C"},
{City: "D"},
},