- Each provider interface can now fetch updated servers data - Rename each provider updater subpackage name to `updater` - Updater constructor does not take a settings struct - Updater update method takes in a slice of provider strings
25 lines
550 B
Go
25 lines
550 B
Go
package updater
|
|
|
|
import "strings"
|
|
|
|
func getHostnameFromCity(city string) (hostname string) {
|
|
host := strings.ToLower(city)
|
|
host = strings.ReplaceAll(host, ".", "")
|
|
host = strings.ReplaceAll(host, " ", "")
|
|
|
|
specialCases := map[string]string{
|
|
"washingtondc": "washington",
|
|
"mexicocity": "mexico",
|
|
"denizli": "bursa",
|
|
"sibu": "kualalumpur",
|
|
"kiev": "kyiv",
|
|
"stpetersburg": "petersburg",
|
|
}
|
|
if specialHost, ok := specialCases[host]; ok {
|
|
host = specialHost
|
|
}
|
|
|
|
hostname = host + ".wevpn.com"
|
|
return hostname
|
|
}
|