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:
20
internal/updater/providers/surfshark/remaining.go
Normal file
20
internal/updater/providers/surfshark/remaining.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package surfshark
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
// getRemainingServers finds extra servers not found in the API or in the ZIP file.
|
||||
func getRemainingServers(hts hostToServer) {
|
||||
hostnameToLocationLeft := constants.SurfsharkHostToLocation()
|
||||
for _, hostnameDone := range hts.toHostsSlice() {
|
||||
delete(hostnameToLocationLeft, hostnameDone)
|
||||
}
|
||||
|
||||
for hostname, locationData := range hostnameToLocationLeft {
|
||||
// we assume the server supports TCP and UDP
|
||||
const tcp, udp = true, true
|
||||
hts.add(hostname, locationData.Region, locationData.Country,
|
||||
locationData.City, locationData.RetroLoc, tcp, udp)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user