chore(portforward): move vpn gateway obtention within port forwarding service

This commit is contained in:
Quentin McGaw
2023-09-23 11:46:14 +00:00
parent 71201411f4
commit 0406de399d
14 changed files with 135 additions and 92 deletions

View File

@@ -2,6 +2,9 @@ package service
import (
"context"
"net/netip"
"github.com/qdm12/gluetun/internal/provider/utils"
)
type PortAllower interface {
@@ -9,8 +12,19 @@ type PortAllower interface {
RemoveAllowedPort(ctx context.Context, port uint16) (err error)
}
type Routing interface {
VPNLocalGatewayIP(vpnInterface string) (gateway netip.Addr, err error)
}
type Logger interface {
Info(s string)
Warn(s string)
Error(s string)
}
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)
}