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

View File

@@ -1,52 +1,54 @@
package models
import "net"
type PIAServer struct {
IPs []net.IP
Region string
type AllServers struct {
Version uint16 `json:"version"`
Cyberghost CyberghostServers `json:"cyberghost"`
Mullvad MullvadServers `json:"mullvad"`
Nordvpn NordvpnServers `json:"nordvpn"`
Pia PiaServers `json:"pia"`
Purevpn PurevpnServers `json:"purevpn"`
Surfshark SurfsharkServers `json:"surfshark"`
Vyprvpn VyprvpnServers `json:"vyprvpn"`
Windscribe WindscribeServers `json:"windscribe"`
}
type MullvadServer struct {
IPs []net.IP
Country string
City string
ISP string
Owned bool
type CyberghostServers struct {
Version uint16 `json:"version"`
Timestamp int64 `json:"timestamp"`
Servers []CyberghostServer `json:"servers"`
}
type WindscribeServer struct {
Region string
IPs []net.IP
type MullvadServers struct {
Version uint16 `json:"version"`
Timestamp int64 `json:"timestamp"`
Servers []MullvadServer `json:"servers"`
}
type SurfsharkServer struct {
Region string
IPs []net.IP
type NordvpnServers struct {
Version uint16 `json:"version"`
Timestamp int64 `json:"timestamp"`
Servers []NordvpnServer `json:"servers"`
}
type CyberghostServer struct {
Region string
Group string
IPs []net.IP
type PiaServers struct {
Version uint16 `json:"version"`
Timestamp int64 `json:"timestamp"`
Servers []PIAServer `json:"servers"`
}
type VyprvpnServer struct {
Region string
IPs []net.IP
type PurevpnServers struct {
Version uint16 `json:"version"`
Timestamp int64 `json:"timestamp"`
Servers []PurevpnServer `json:"purevpn"`
}
type NordvpnServer struct { //nolint:maligned
Region string
Number uint16
IP net.IP
TCP bool
UDP bool
type SurfsharkServers struct {
Version uint16 `json:"version"`
Timestamp int64 `json:"timestamp"`
Servers []SurfsharkServer `json:"servers"`
}
type PurevpnServer struct {
Region string
Country string
City string
IPs []net.IP
type VyprvpnServers struct {
Version uint16 `json:"version"`
Timestamp int64 `json:"timestamp"`
Servers []VyprvpnServer `json:"servers"`
}
type WindscribeServers struct {
Version uint16 `json:"version"`
Timestamp int64 `json:"timestamp"`
Servers []WindscribeServer `json:"servers"`
}