chore(protonvpn): remove unused exit IPs field
This commit is contained in:
@@ -181,7 +181,6 @@ func (a *AllServers) GetProtonvpn() (servers []ProtonvpnServer) {
|
||||
for i, serverToCopy := range a.Protonvpn.Servers {
|
||||
servers[i] = serverToCopy
|
||||
servers[i].EntryIP = copyIP(serverToCopy.EntryIP)
|
||||
servers[i].ExitIPs = copyIPs(serverToCopy.ExitIPs)
|
||||
}
|
||||
return servers
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ func Test_AllServers_GetCopy(t *testing.T) {
|
||||
Protonvpn: ProtonvpnServers{
|
||||
Servers: []ProtonvpnServer{{
|
||||
EntryIP: net.IP{1, 2, 3, 4},
|
||||
ExitIPs: []net.IP{{1, 2, 3, 4}},
|
||||
}},
|
||||
},
|
||||
Purevpn: PurevpnServers{
|
||||
|
||||
@@ -114,13 +114,12 @@ type PrivatevpnServer struct {
|
||||
}
|
||||
|
||||
type ProtonvpnServer struct {
|
||||
Country string `json:"country,omitempty"`
|
||||
Region string `json:"region,omitempty"`
|
||||
City string `json:"city,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
EntryIP net.IP `json:"entry_ip,omitempty"`
|
||||
ExitIPs []net.IP `json:"exit_ip,omitempty"` // TODO verify it matches with public IP once connected
|
||||
Country string `json:"country,omitempty"`
|
||||
Region string `json:"region,omitempty"`
|
||||
City string `json:"city,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
EntryIP net.IP `json:"entry_ip,omitempty"`
|
||||
}
|
||||
|
||||
type PurevpnServer struct {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@ import (
|
||||
type ipToServer map[string]models.ProtonvpnServer
|
||||
|
||||
func (its ipToServer) add(country, region, city, name, hostname string,
|
||||
entryIP, exitIP net.IP) {
|
||||
entryIP net.IP) {
|
||||
key := entryIP.String()
|
||||
|
||||
server, ok := its[key]
|
||||
@@ -20,9 +20,6 @@ func (its ipToServer) add(country, region, city, name, hostname string,
|
||||
server.Name = name
|
||||
server.Hostname = hostname
|
||||
server.EntryIP = entryIP
|
||||
server.ExitIPs = []net.IP{exitIP}
|
||||
} else {
|
||||
server.ExitIPs = append(server.ExitIPs, exitIP)
|
||||
}
|
||||
|
||||
its[key] = server
|
||||
|
||||
@@ -47,7 +47,6 @@ func GetServers(ctx context.Context, client *http.Client, minServers int) (
|
||||
|
||||
hostname := physicalServer.Domain
|
||||
entryIP := physicalServer.EntryIP
|
||||
exitIP := physicalServer.ExitIP
|
||||
|
||||
// Note: for multi-hop use the server name or hostname
|
||||
// instead of the country
|
||||
@@ -57,7 +56,7 @@ func GetServers(ctx context.Context, client *http.Client, minServers int) (
|
||||
warnings = append(warnings, warning)
|
||||
}
|
||||
|
||||
ipToServer.add(country, region, city, name, hostname, entryIP, exitIP)
|
||||
ipToServer.add(country, region, city, name, hostname, entryIP)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user