Feature: filter by hostname for PureVPN servers

- Record support for TCP and UDP for each hostname
- Fix: each hostname supports only TCP or UDP, not both
- Update PureVPN server information
This commit is contained in:
Quentin McGaw
2021-05-10 00:36:14 +00:00
parent 4fe1e062f2
commit 6c1c069261
11 changed files with 185 additions and 103 deletions

View File

@@ -8,9 +8,18 @@ import (
type hostToServer map[string]models.PurevpnServer
func (hts hostToServer) add(host string) {
// TODO set TCP and UDP compatibility, set hostname
hts[host] = models.PurevpnServer{}
func (hts hostToServer) add(host string, tcp, udp bool) {
server, ok := hts[host]
if !ok {
server.Hostname = host
}
if tcp {
server.TCP = true
}
if udp {
server.UDP = true
}
hts[host] = server
}
func (hts hostToServer) toHostsSlice() (hosts []string) {