Maintenance: split each provider in a package

- Fix VyprVPN port
- Fix missing Auth overrides
This commit is contained in:
Quentin McGaw
2021-05-11 17:10:51 +00:00
parent 1cb93d76ed
commit e8c8742bae
104 changed files with 3685 additions and 3026 deletions

View File

@@ -0,0 +1,22 @@
package utils
import (
"errors"
"fmt"
"net"
"github.com/qdm12/gluetun/internal/models"
)
var ErrTargetIPNotFound = errors.New("target IP address not found")
func GetTargetIPConnection(connections []models.OpenVPNConnection,
targetIP net.IP) (connection models.OpenVPNConnection, err error) {
for _, connection := range connections {
if targetIP.Equal(connection.IP) {
return connection, nil
}
}
return connection, fmt.Errorf("%w: in %d filtered connections",
ErrTargetIPNotFound, len(connections))
}