Persistent server pools (#226)

* GetAllServers with version & timestamp tests
* Storage package to sync servers
* Use storage Sync to get and use servers
This commit is contained in:
Quentin McGaw
2020-08-25 19:38:50 -04:00
committed by GitHub
parent 6fc2b3dd21
commit aa9693a84d
23 changed files with 464 additions and 83 deletions

52
internal/models/server.go Normal file
View File

@@ -0,0 +1,52 @@
package models
import "net"
type PIAServer struct {
IPs []net.IP `json:"ips"`
Region string `json:"region"`
}
type MullvadServer struct {
IPs []net.IP `json:"ips"`
Country string `json:"country"`
City string `json:"city"`
ISP string `json:"isp"`
Owned bool `json:"owned"`
}
type WindscribeServer struct {
Region string `json:"region"`
IPs []net.IP `json:"ips"`
}
type SurfsharkServer struct {
Region string `json:"region"`
IPs []net.IP `json:"ips"`
}
type CyberghostServer struct {
Region string `json:"region"`
Group string `json:"group"`
IPs []net.IP `json:"ips"`
}
type VyprvpnServer struct {
Region string `json:"region"`
IPs []net.IP `json:"ips"`
}
type NordvpnServer struct { //nolint:maligned
Region string `json:"region"`
Number uint16 `json:"number"`
IP net.IP `json:"ip"`
TCP bool `json:"tcp"`
UDP bool `json:"udp"`
}
type PurevpnServer struct {
Region string `json:"region"`
Country string `json:"country"`
City string `json:"city"`
IPs []net.IP `json:"ips"`
}