chore(provider): use type assertion for port forwarders

This commit is contained in:
Quentin McGaw
2023-09-23 13:02:09 +00:00
parent 84300db7c1
commit aa6dc786a4
29 changed files with 129 additions and 185 deletions

View File

@@ -5,7 +5,6 @@ import (
"github.com/qdm12/gluetun/internal/configuration/settings"
"github.com/qdm12/gluetun/internal/models"
"github.com/qdm12/gluetun/internal/provider/utils"
)
// Provider contains methods to read and modify the openvpn configuration to connect as a client.
@@ -13,14 +12,6 @@ type Provider interface {
GetConnection(selection settings.ServerSelection, ipv6Supported bool) (connection models.Connection, err error)
OpenVPNConfig(connection models.Connection, settings settings.OpenVPN, ipv6Supported bool) (lines []string)
Name() string
PortForwarder
FetchServers(ctx context.Context, minServers int) (
servers []models.Server, err error)
}
type PortForwarder interface {
Name() string
PortForward(ctx context.Context, objects utils.PortForwardObjects) (
port uint16, err error)
KeepPortForward(ctx context.Context, objects utils.PortForwardObjects) (err error)
}