Maint: deduplicate ProtonVPN servers by entry IP
This commit is contained in:
@@ -168,7 +168,7 @@ func (a *AllServers) GetProtonvpn() (servers []ProtonvpnServer) {
|
||||
for i, serverToCopy := range a.Protonvpn.Servers {
|
||||
servers[i] = serverToCopy
|
||||
servers[i].EntryIP = copyIP(serverToCopy.EntryIP)
|
||||
servers[i].ExitIP = copyIP(serverToCopy.ExitIP)
|
||||
servers[i].ExitIPs = copyIPs(serverToCopy.ExitIPs)
|
||||
}
|
||||
return servers
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ func Test_AllServers_GetCopy(t *testing.T) {
|
||||
Protonvpn: ProtonvpnServers{
|
||||
Servers: []ProtonvpnServer{{
|
||||
EntryIP: net.IP{1, 2, 3, 4},
|
||||
ExitIP: net.IP{1, 2, 3, 4},
|
||||
ExitIPs: []net.IP{{1, 2, 3, 4}},
|
||||
}},
|
||||
},
|
||||
Purevpn: PurevpnServers{
|
||||
|
||||
@@ -107,13 +107,13 @@ type PrivatevpnServer struct {
|
||||
}
|
||||
|
||||
type ProtonvpnServer struct {
|
||||
Country string `json:"country"`
|
||||
Region string `json:"region"`
|
||||
City string `json:"city"`
|
||||
Name string `json:"name"`
|
||||
Hostname string `json:"hostname"`
|
||||
EntryIP net.IP `json:"entry_ip"`
|
||||
ExitIP net.IP `json:"exit_ip"` // TODO verify it matches with public IP once connected
|
||||
Country string `json:"country"`
|
||||
Region string `json:"region"`
|
||||
City string `json:"city"`
|
||||
Name string `json:"name"`
|
||||
Hostname string `json:"hostname"`
|
||||
EntryIP net.IP `json:"entry_ip"`
|
||||
ExitIPs []net.IP `json:"exit_ip"` // TODO verify it matches with public IP once connected
|
||||
}
|
||||
|
||||
type PurevpnServer struct {
|
||||
|
||||
Reference in New Issue
Block a user