chore(all): return concrete types, accept interfaces

- Remove exported interfaces unused locally
- Define interfaces to accept arguments
- Return concrete types, not interfaces
This commit is contained in:
Quentin McGaw
2022-06-11 01:34:30 +00:00
parent 0378fe4a7b
commit 578ef768ab
132 changed files with 594 additions and 935 deletions

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"github.com/qdm12/gluetun/internal/configuration/settings"
"github.com/qdm12/gluetun/internal/firewall"
"github.com/qdm12/gluetun/internal/openvpn"
"github.com/qdm12/gluetun/internal/provider"
"github.com/qdm12/golibs/command"
@@ -13,10 +12,10 @@ import (
// setupOpenVPN sets OpenVPN up using the configurators and settings given.
// It returns a serverName for port forwarding (PIA) and an error if it fails.
func setupOpenVPN(ctx context.Context, fw firewall.VPNConnectionSetter,
openvpnConf openvpn.Interface, providerConf provider.Provider,
func setupOpenVPN(ctx context.Context, fw Firewall,
openvpnConf OpenVPN, providerConf provider.Provider,
settings settings.VPN, starter command.Starter, logger openvpn.Logger) (
runner vpnRunner, serverName string, err error) {
runner *openvpn.Runner, serverName string, err error) {
connection, err := providerConf.GetConnection(settings.Provider.ServerSelection)
if err != nil {
return nil, "", fmt.Errorf("failed finding a valid server connection: %w", err)