Feature: Filter VyprVPN servers by hostname, and:
- Extract if server supports TCP and UDP (never TCP now) - Filter servers by protocol (unused for now)
This commit is contained in:
@@ -8,13 +8,19 @@ import (
|
||||
|
||||
type hostToServer map[string]models.VyprvpnServer
|
||||
|
||||
func (hts hostToServer) add(host, region string) {
|
||||
func (hts hostToServer) add(host, region string, tcp, udp bool) {
|
||||
server, ok := hts[host]
|
||||
// TODO set host
|
||||
if !ok {
|
||||
server.Hostname = host
|
||||
server.Region = region
|
||||
hts[host] = server
|
||||
}
|
||||
if tcp {
|
||||
server.TCP = true
|
||||
}
|
||||
if udp {
|
||||
server.UDP = true
|
||||
}
|
||||
hts[host] = server
|
||||
}
|
||||
|
||||
func (hts hostToServer) toHostsSlice() (hosts []string) {
|
||||
|
||||
Reference in New Issue
Block a user