chore(all): remove unexported interfaces

This commit is contained in:
Quentin McGaw
2022-06-12 00:57:37 +00:00
parent 89277828ac
commit bda6707685
18 changed files with 37 additions and 113 deletions

View File

@@ -32,11 +32,6 @@ type OpenVPN interface {
WriteAuthFile(user, password string) error
}
type StateManager interface {
GetSettings() (vpn settings.VPN)
SetSettings(ctx context.Context, vpn settings.VPN) (outcome string)
}
type Providers interface {
Get(providerName string) provider.Provider
}
@@ -73,16 +68,3 @@ type PublicIPLoop interface {
outcome string, err error)
SetData(data ipinfo.Response)
}
type statusManager interface {
GetStatus() (status models.LoopStatus)
SetStatus(status models.LoopStatus)
ApplyStatus(ctx context.Context, status models.LoopStatus) (
outcome string, err error)
Lock()
Unlock()
}
type runner interface {
Run(ctx context.Context, waitError chan<- error, tunnelReady chan<- struct{})
}

View File

@@ -14,8 +14,8 @@ import (
)
type Loop struct {
statusManager statusManager
state StateManager
statusManager *loopstate.State
state *state.State
providers Providers
storage Storage
// Fixed parameters

View File

@@ -23,7 +23,9 @@ func (l *Loop) Run(ctx context.Context, done chan<- struct{}) {
providerConf := l.providers.Get(*settings.Provider.Name)
portForwarding := *settings.Provider.PortForwarding.Enabled
var vpnRunner runner
var vpnRunner interface {
Run(ctx context.Context, waitError chan<- error, tunnelReady chan<- struct{})
}
var serverName, vpnInterface string
var err error
subLogger := l.logger.New(log.SetComponent(settings.Type))