Improve panic message for empty connection
This commit is contained in:
@@ -5,10 +5,10 @@ import (
|
||||
)
|
||||
|
||||
type OpenVPNConnection struct {
|
||||
IP net.IP
|
||||
Port uint16
|
||||
Protocol NetworkProtocol
|
||||
Hostname string // Privado for tls verification
|
||||
IP net.IP `json:"ip"`
|
||||
Port uint16 `json:"port"`
|
||||
Protocol NetworkProtocol `json:"protocol"`
|
||||
Hostname string `json:"hostname"` // Privado for tls verification
|
||||
}
|
||||
|
||||
func (o *OpenVPNConnection) Equal(other OpenVPNConnection) bool {
|
||||
|
||||
@@ -13,6 +13,18 @@ type AllServers struct {
|
||||
Windscribe WindscribeServers `json:"windscribe"`
|
||||
}
|
||||
|
||||
func (a *AllServers) Count() int {
|
||||
return len(a.Cyberghost.Servers) +
|
||||
len(a.Mullvad.Servers) +
|
||||
len(a.Nordvpn.Servers) +
|
||||
len(a.Pia.Servers) +
|
||||
len(a.Privado.Servers) +
|
||||
len(a.Purevpn.Servers) +
|
||||
len(a.Surfshark.Servers) +
|
||||
len(a.Vyprvpn.Servers) +
|
||||
len(a.Windscribe.Servers)
|
||||
}
|
||||
|
||||
type CyberghostServers struct {
|
||||
Version uint16 `json:"version"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
|
||||
Reference in New Issue
Block a user