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:
Quentin McGaw
2021-05-10 02:12:13 +00:00
parent 95b0fb81d6
commit 2d95edf8ab
7 changed files with 110 additions and 87 deletions

View File

@@ -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) {