From a76f86164aecd7adfdca373b044ba250acbd58b2 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Thu, 7 Mar 2024 14:28:39 +0100 Subject: Config: Fix current server and profiles for v1 -> v2 --- internal/config/v1/v1.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'internal/config/v1') 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 -- cgit v1.2.3