summaryrefslogtreecommitdiff
path: root/internal/config/v1
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-03-07 14:28:39 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2024-03-07 14:28:39 +0100
commita76f86164aecd7adfdca373b044ba250acbd58b2 (patch)
tree56a0f172f68a0b14ab0a61d70bab1af7e848229b /internal/config/v1
parent987f2e3041e0b5d6e06cdc29657be99de9c1cd60 (diff)
Config: Fix current server and profiles for v1 -> v2
Diffstat (limited to 'internal/config/v1')
-rw-r--r--internal/config/v1/v1.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/internal/config/v1/v1.go b/internal/config/v1/v1.go
index 1d96d13..04fdf6b 100644
--- a/internal/config/v1/v1.go
+++ b/internal/config/v1/v1.go
@@ -9,7 +9,6 @@ import (
"github.com/eduvpn/eduvpn-common/internal/api/profiles"
"github.com/eduvpn/eduvpn-common/internal/discovery"
- "github.com/eduvpn/eduvpn-common/types/server"
)
// Profiles is the list of profiles
@@ -36,8 +35,6 @@ type Base struct {
type InstituteServer struct {
// Base is the base of the server
Base Base `json:"base"`
- // Profiles are the list of profiles
- Profiles Profiles `json:"profiles"`
}
// InstituteServers is a list of institute access servers
@@ -67,6 +64,14 @@ type SecureInternetHome struct {
CurrentLocation string `json:"current_location"`
}
+type Type int8
+
+const (
+ CustomServerType Type = iota
+ InstituteAccessServerType
+ SecureInternetServerType
+)
+
// Servers represents the list of servers
type Servers struct {
// Custom are the "custom" servers; the servers that are added by the user
@@ -77,7 +82,7 @@ type Servers struct {
// Also obtained through discovery
SecureInternetHome SecureInternetHome `json:"secure_internet_home"`
// IsType represents which server type was last configured
- IsType server.Type `json:"is_secure_internet"`
+ IsType Type `json:"is_secure_internet"`
}
// V1 is the top-level struct for the first version of the state file