Feature: FastestVPN support (#383)
This commit is contained in:
@@ -17,6 +17,19 @@ func (s *CyberghostServer) String() string {
|
||||
return fmt.Sprintf("{Region: %q, Group: %q, IPs: %s}", s.Region, s.Group, goStringifyIPs(s.IPs))
|
||||
}
|
||||
|
||||
type FastestvpnServer struct {
|
||||
Hostname string `json:"hostname"`
|
||||
TCP bool `json:"tcp"`
|
||||
UDP bool `json:"udp"`
|
||||
Country string `json:"country"`
|
||||
IPs []net.IP `json:"ips"`
|
||||
}
|
||||
|
||||
func (s *FastestvpnServer) String() string {
|
||||
return fmt.Sprintf("{Country: %q, Hostname: %q, UDP: %t, TCP: %t, IPs: %s}",
|
||||
s.Country, s.Hostname, s.UDP, s.TCP, goStringifyIPs(s.IPs))
|
||||
}
|
||||
|
||||
type HideMyAssServer struct {
|
||||
Country string `json:"country"`
|
||||
Region string `json:"region"`
|
||||
@@ -83,6 +96,18 @@ func (p *PIAServer) String() string {
|
||||
p.Region, p.ServerName, p.TCP, p.UDP, p.PortForward, goStringifyIP(p.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))
|
||||
}
|
||||
|
||||
type PurevpnServer struct {
|
||||
Country string `json:"country"`
|
||||
Region string `json:"region"`
|
||||
@@ -137,18 +162,6 @@ 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{"), "}")
|
||||
|
||||
@@ -3,6 +3,7 @@ package models
|
||||
type AllServers struct {
|
||||
Version uint16 `json:"version"`
|
||||
Cyberghost CyberghostServers `json:"cyberghost"`
|
||||
Fastestvpn FastestvpnServers `json:"fastestvpn"`
|
||||
HideMyAss HideMyAssServers `json:"hidemyass"`
|
||||
Mullvad MullvadServers `json:"mullvad"`
|
||||
Nordvpn NordvpnServers `json:"nordvpn"`
|
||||
@@ -18,6 +19,7 @@ type AllServers struct {
|
||||
|
||||
func (a *AllServers) Count() int {
|
||||
return len(a.Cyberghost.Servers) +
|
||||
len(a.Fastestvpn.Servers) +
|
||||
len(a.HideMyAss.Servers) +
|
||||
len(a.Mullvad.Servers) +
|
||||
len(a.Nordvpn.Servers) +
|
||||
@@ -36,6 +38,11 @@ type CyberghostServers struct {
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Servers []CyberghostServer `json:"servers"`
|
||||
}
|
||||
type FastestvpnServers struct {
|
||||
Version uint16 `json:"version"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Servers []FastestvpnServer `json:"servers"`
|
||||
}
|
||||
type HideMyAssServers struct {
|
||||
Version uint16 `json:"version"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
|
||||
Reference in New Issue
Block a user