Feature: filter Surfshark servers by hostname

This commit is contained in:
Quentin McGaw
2021-05-10 01:24:46 +00:00
parent 6c1c069261
commit eff65dce00
9 changed files with 238 additions and 175 deletions

View File

@@ -9,6 +9,10 @@ func (settings *Provider) surfsharkLines() (lines []string) {
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
}
if len(settings.ServerSelection.Hostnames) > 0 {
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
}
return lines
}
@@ -30,5 +34,10 @@ func (settings *Provider) readSurfshark(r reader) (err error) {
return err
}
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.SurfsharkHostnameChoices())
if err != nil {
return err
}
return nil
}