Maint: migrate Cyberghost REGION to COUNTRY
This commit is contained in:
@@ -21,12 +21,12 @@ func getPossibleServers() (possibleServers hostToServer) {
|
||||
possibleServers = make(hostToServer, n) // key is the host
|
||||
|
||||
for groupID, groupName := range groups {
|
||||
for countryCode, region := range possibleCountryCodes {
|
||||
for countryCode, country := range possibleCountryCodes {
|
||||
const domain = "cg-dialup.net"
|
||||
possibleHost := groupID + "-" + countryCode + "." + domain
|
||||
possibleServer := models.CyberghostServer{
|
||||
Hostname: possibleHost,
|
||||
Region: region,
|
||||
Country: country,
|
||||
Group: groupName,
|
||||
}
|
||||
possibleServers[possibleHost] = possibleServer
|
||||
|
||||
@@ -8,12 +8,12 @@ import (
|
||||
|
||||
func sortServers(servers []models.CyberghostServer) {
|
||||
sort.Slice(servers, func(i, j int) bool {
|
||||
if servers[i].Region == servers[j].Region {
|
||||
if servers[i].Country == servers[j].Country {
|
||||
if servers[i].Group == servers[j].Group {
|
||||
return servers[i].Hostname < servers[j].Hostname
|
||||
}
|
||||
return servers[i].Group < servers[j].Group
|
||||
}
|
||||
return servers[i].Region < servers[j].Region
|
||||
return servers[i].Country < servers[j].Country
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user