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

@@ -1,6 +1,9 @@
package portforward
import "context"
import (
"context"
"net/netip"
)
type Service interface {
Start(ctx context.Context) (runError <-chan error, err error)
@@ -8,6 +11,10 @@ type Service interface {
GetPortForwarded() (port uint16)
}
type Routing interface {
VPNLocalGatewayIP(vpnInterface string) (gateway netip.Addr, err error)
}
type PortAllower interface {
SetAllowedPort(ctx context.Context, port uint16, intf string) (err error)
RemoveAllowedPort(ctx context.Context, port uint16) (err error)