chore(models): common Server & Servers for all providers (#943)

This commit is contained in:
Quentin McGaw
2022-04-16 22:25:36 +02:00
parent aa729515b9
commit 5d66c193aa
148 changed files with 27081 additions and 27795 deletions

View File

@@ -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)
}

View File

@@ -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,