Privado support, fix #285 (#288)

This commit is contained in:
Quentin McGaw
2020-11-08 20:56:49 -05:00
committed by GitHub
parent 0423388b52
commit f1e4b9937b
24 changed files with 610 additions and 9 deletions

View File

@@ -107,6 +107,17 @@ func (s *PurevpnServer) String() string {
s.Region, s.Country, s.City, goStringifyIPs(s.IPs))
}
type PrivadoServer struct {
IP net.IP `json:"ip"`
City string `json:"city"`
Number uint16 `json:"number"`
}
func (s *PrivadoServer) String() string {
return fmt.Sprintf("{City: %q, Number: %d, IP: %s}",
s.City, s.Number, goStringifyIP(s.IP))
}
func goStringifyIP(ip net.IP) string {
s := fmt.Sprintf("%#v", ip)
s = strings.TrimSuffix(strings.TrimPrefix(s, "net.IP{"), "}")