chore(models): streamline all server models IPs (#942)

- Use `IPs []net.IP` for all server models
- Use `ips` JSON field for all server models
- Merge IPv4 and IPv6 addresses together for Mullvad
This commit is contained in:
Quentin McGaw
2022-04-16 21:58:42 +02:00
parent 54b7e23974
commit aa729515b9
18 changed files with 26277 additions and 12234 deletions

View File

@@ -63,7 +63,6 @@ type IvpnServer struct {
type MullvadServer struct {
VPN string `json:"vpn,omitempty"`
IPs []net.IP `json:"ips,omitempty"`
IPsV6 []net.IP `json:"ipsv6,omitempty"`
Country string `json:"country,omitempty"`
City string `json:"city,omitempty"`
Hostname string `json:"hostname,omitempty"`
@@ -73,12 +72,12 @@ type MullvadServer struct {
}
type NordvpnServer struct { //nolint:maligned
Region string `json:"region,omitempty"`
Hostname string `json:"hostname,omitempty"`
Number uint16 `json:"number,omitempty"`
IP net.IP `json:"ip,omitempty"`
TCP bool `json:"tcp,omitempty"`
UDP bool `json:"udp,omitempty"`
Region string `json:"region,omitempty"`
Hostname string `json:"hostname,omitempty"`
Number uint16 `json:"number,omitempty"`
IPs []net.IP `json:"ips,omitempty"`
TCP bool `json:"tcp,omitempty"`
UDP bool `json:"udp,omitempty"`
}
type PerfectprivacyServer struct {
@@ -89,11 +88,11 @@ type PerfectprivacyServer struct {
}
type PrivadoServer struct {
Country string `json:"country,omitempty"`
Region string `json:"region,omitempty"`
City string `json:"city,omitempty"`
Hostname string `json:"hostname,omitempty"`
IP net.IP `json:"ip,omitempty"`
Country string `json:"country,omitempty"`
Region string `json:"region,omitempty"`
City string `json:"city,omitempty"`
Hostname string `json:"hostname,omitempty"`
IPs []net.IP `json:"ips,omitempty"`
}
type PIAServer struct {
@@ -110,16 +109,16 @@ type PrivatevpnServer struct {
Country string `json:"country,omitempty"`
City string `json:"city,omitempty"`
Hostname string `json:"hostname,omitempty"`
IPs []net.IP `json:"ip,omitempty"`
IPs []net.IP `json:"ips,omitempty"`
}
type ProtonvpnServer struct {
Country string `json:"country,omitempty"`
Region string `json:"region,omitempty"`
City string `json:"city,omitempty"`
Name string `json:"server_name,omitempty"`
Hostname string `json:"hostname,omitempty"`
EntryIP net.IP `json:"entry_ip,omitempty"`
Country string `json:"country,omitempty"`
Region string `json:"region,omitempty"`
City string `json:"city,omitempty"`
Name string `json:"server_name,omitempty"`
Hostname string `json:"hostname,omitempty"`
IPs []net.IP `json:"ips,omitempty"`
}
type PurevpnServer struct {