Maint: openvpn configurator interface composition

This commit is contained in:
Quentin McGaw (desktop)
2021-07-26 16:03:04 +00:00
parent d5ba15c23b
commit 430512dd27
5 changed files with 37 additions and 10 deletions

View File

@@ -8,6 +8,15 @@ import (
"github.com/qdm12/gluetun/internal/unix"
)
type TUNCheckCreater interface {
TUNChecker
TUNCreater
}
type TUNChecker interface {
CheckTUN() error
}
// CheckTUN checks the tunnel device is present and accessible.
func (c *configurator) CheckTUN() error {
c.logger.Info("checking for device " + c.tunDevPath)
@@ -21,6 +30,10 @@ func (c *configurator) CheckTUN() error {
return nil
}
type TUNCreater interface {
CreateTUN() error
}
func (c *configurator) CreateTUN() error {
c.logger.Info("creating " + c.tunDevPath)