- 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
428 B
Go
20 lines
428 B
Go
package purevpn
|
|
|
|
import (
|
|
"sort"
|
|
|
|
"github.com/qdm12/gluetun/internal/models"
|
|
)
|
|
|
|
func sortServers(servers []models.PurevpnServer) {
|
|
sort.Slice(servers, func(i, j int) bool {
|
|
if servers[i].Country == servers[j].Country {
|
|
if servers[i].Region == servers[j].Region {
|
|
return servers[i].City < servers[j].City
|
|
}
|
|
return servers[i].Region < servers[j].Region
|
|
}
|
|
return servers[i].Country < servers[j].Country
|
|
})
|
|
}
|