- Move validation functions from `internal/constants` to `internal/configuration/settings/validation` - Concatenate all OpenVPN constants in `internal/constants/openvpn.go`
30 lines
719 B
Go
30 lines
719 B
Go
package validation
|
|
|
|
import (
|
|
"github.com/qdm12/gluetun/internal/models"
|
|
)
|
|
|
|
func IpvanishCountryChoices(servers []models.IpvanishServer) (choices []string) {
|
|
choices = make([]string, len(servers))
|
|
for i := range servers {
|
|
choices[i] = servers[i].Country
|
|
}
|
|
return makeUnique(choices)
|
|
}
|
|
|
|
func IpvanishCityChoices(servers []models.IpvanishServer) (choices []string) {
|
|
choices = make([]string, len(servers))
|
|
for i := range servers {
|
|
choices[i] = servers[i].City
|
|
}
|
|
return makeUnique(choices)
|
|
}
|
|
|
|
func IpvanishHostnameChoices(servers []models.IpvanishServer) (choices []string) {
|
|
choices = make([]string, len(servers))
|
|
for i := range servers {
|
|
choices[i] = servers[i].Hostname
|
|
}
|
|
return makeUnique(choices)
|
|
}
|