- Require at least 80% of number of servers now to pass - Each provider is in its own package with a common structure - Unzip package with unzipper interface - Openvpn package with extraction and download functions
20 lines
430 B
Go
20 lines
430 B
Go
package torguard
|
|
|
|
import (
|
|
"sort"
|
|
|
|
"github.com/qdm12/gluetun/internal/models"
|
|
)
|
|
|
|
func sortServers(servers []models.TorguardServer) {
|
|
sort.Slice(servers, func(i, j int) bool {
|
|
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
|
|
})
|
|
}
|