chore(models): common Server & Servers for all providers (#943)
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func (p *Protonvpn) filterServers(selection settings.ServerSelection) (
|
||||
servers []models.ProtonvpnServer, err error) {
|
||||
servers []models.Server, err error) {
|
||||
for _, server := range p.servers {
|
||||
switch {
|
||||
case
|
||||
@@ -17,8 +17,8 @@ func (p *Protonvpn) filterServers(selection settings.ServerSelection) (
|
||||
utils.FilterByPossibilities(server.Region, selection.Regions),
|
||||
utils.FilterByPossibilities(server.City, selection.Cities),
|
||||
utils.FilterByPossibilities(server.Hostname, selection.Hostnames),
|
||||
utils.FilterByPossibilities(server.Name, selection.Names),
|
||||
*selection.FreeOnly && !strings.Contains(strings.ToLower(server.Name), "free"):
|
||||
utils.FilterByPossibilities(server.ServerName, selection.Names),
|
||||
*selection.FreeOnly && !strings.Contains(strings.ToLower(server.ServerName), "free"):
|
||||
default:
|
||||
servers = append(servers, server)
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ import (
|
||||
)
|
||||
|
||||
type Protonvpn struct {
|
||||
servers []models.ProtonvpnServer
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.ProtonvpnServer, randSource rand.Source) *Protonvpn {
|
||||
func New(servers []models.Server, randSource rand.Source) *Protonvpn {
|
||||
return &Protonvpn{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
|
||||
Reference in New Issue
Block a user