Feature: PrivateVPN support (#393)
This commit is contained in:
@@ -137,6 +137,18 @@ func (s *WindscribeServer) String() string {
|
||||
s.Region, s.City, s.Hostname, goStringifyIP(s.IP))
|
||||
}
|
||||
|
||||
type PrivatevpnServer struct {
|
||||
Country string `json:"country"`
|
||||
City string `json:"city"`
|
||||
Hostname string `json:"hostname"`
|
||||
IPs []net.IP `json:"ip"`
|
||||
}
|
||||
|
||||
func (s *PrivatevpnServer) String() string {
|
||||
return fmt.Sprintf("{Country: %q, City: %q, Hostname: %q, IPs: %s}",
|
||||
s.Country, s.City, s.Hostname, goStringifyIPs(s.IPs))
|
||||
}
|
||||
|
||||
func goStringifyIP(ip net.IP) string {
|
||||
s := fmt.Sprintf("%#v", ip)
|
||||
s = strings.TrimSuffix(strings.TrimPrefix(s, "net.IP{"), "}")
|
||||
|
||||
@@ -8,6 +8,7 @@ type AllServers struct {
|
||||
Nordvpn NordvpnServers `json:"nordvpn"`
|
||||
Privado PrivadoServers `json:"privado"`
|
||||
Pia PiaServers `json:"pia"`
|
||||
Privatevpn PrivatevpnServers `json:"privatevpn"`
|
||||
Purevpn PurevpnServers `json:"purevpn"`
|
||||
Surfshark SurfsharkServers `json:"surfshark"`
|
||||
Torguard TorguardServers `json:"torguard"`
|
||||
@@ -22,6 +23,7 @@ func (a *AllServers) Count() int {
|
||||
len(a.Nordvpn.Servers) +
|
||||
len(a.Privado.Servers) +
|
||||
len(a.Pia.Servers) +
|
||||
len(a.Privatevpn.Servers) +
|
||||
len(a.Purevpn.Servers) +
|
||||
len(a.Surfshark.Servers) +
|
||||
len(a.Torguard.Servers) +
|
||||
@@ -59,6 +61,11 @@ type PiaServers struct {
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Servers []PIAServer `json:"servers"`
|
||||
}
|
||||
type PrivatevpnServers struct {
|
||||
Version uint16 `json:"version"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Servers []PrivatevpnServer `json:"servers"`
|
||||
}
|
||||
type PurevpnServers struct {
|
||||
Version uint16 `json:"version"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
|
||||
Reference in New Issue
Block a user