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:
52
internal/models/server.go
Normal file
52
internal/models/server.go
Normal 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"`
|
||||
}
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user