mirror of
https://github.com/qdm12/gluetun.git
synced 2026-06-21 11:24:14 +02:00
Feat: rework Surfshark servers data (#575)
- Feat: `MULTIHOP_ONLY` variable - Feat: `COUNTRY` variable - Feat: `CITY` variable - Feat: `REGION` variable, with retro-compatibility - Feat: merge servers from API, zip and hardcoded hostnames - Fix: remove outdated and duplicate servers - Maint: faster update with fully parallel DNS resolutions
This commit is contained in:
@@ -9,7 +9,13 @@ import (
|
||||
func sortServers(servers []models.SurfsharkServer) {
|
||||
sort.Slice(servers, func(i, j int) bool {
|
||||
if servers[i].Region == servers[j].Region {
|
||||
return servers[i].Hostname < servers[j].Hostname
|
||||
if servers[i].Country == servers[j].Country {
|
||||
if servers[i].City == servers[j].City {
|
||||
return servers[i].Hostname < servers[j].Hostname
|
||||
}
|
||||
return servers[i].City < servers[j].City
|
||||
}
|
||||
return servers[i].Country < servers[j].Country
|
||||
}
|
||||
return servers[i].Region < servers[j].Region
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user