- 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
23 lines
536 B
Go
23 lines
536 B
Go
package surfshark
|
|
|
|
import (
|
|
"sort"
|
|
|
|
"github.com/qdm12/gluetun/internal/models"
|
|
)
|
|
|
|
func sortServers(servers []models.SurfsharkServer) {
|
|
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].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
|
|
})
|
|
}
|