chore(portforward): move vpn gateway obtention within port forwarding service
This commit is contained in:
27
internal/provider/utils/portforward.go
Normal file
27
internal/provider/utils/portforward.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/netip"
|
||||
)
|
||||
|
||||
// PortForwardObjects contains fields that may or may not need to be set
|
||||
// depending on the port forwarding provider code.
|
||||
type PortForwardObjects struct {
|
||||
// Logger is a logger, used by both Private Internet Access and ProtonVPN.
|
||||
Logger Logger
|
||||
// Gateway is the VPN gateway IP address, used by Private Internet Access
|
||||
// and ProtonVPN.
|
||||
Gateway netip.Addr
|
||||
// Client is used to query the VPN gateway for Private Internet Access.
|
||||
Client *http.Client
|
||||
// ServerName is used by Private Internet Access for port forwarding,
|
||||
// and to look up the server data from storage.
|
||||
// TODO use server data directly to remove storage dependency for port
|
||||
// forwarding implementation.
|
||||
ServerName string
|
||||
}
|
||||
|
||||
type Routing interface {
|
||||
VPNLocalGatewayIP(vpnInterface string) (gateway netip.Addr, err error)
|
||||
}
|
||||
Reference in New Issue
Block a user