mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-16 13:40:17 +02:00
Maint: openvpn configurator interface composition
This commit is contained in:
@@ -18,6 +18,11 @@ const (
|
||||
binOpenvpn25 = "openvpn"
|
||||
)
|
||||
|
||||
type Starter interface {
|
||||
Start(ctx context.Context, version string, flags []string) (
|
||||
stdoutLines, stderrLines chan string, waitError chan error, err error)
|
||||
}
|
||||
|
||||
func (c *configurator) Start(ctx context.Context, version string, flags []string) (
|
||||
stdoutLines, stderrLines chan string, waitError chan error, err error) {
|
||||
var bin string
|
||||
@@ -40,6 +45,11 @@ func (c *configurator) Start(ctx context.Context, version string, flags []string
|
||||
return c.cmder.Start(cmd)
|
||||
}
|
||||
|
||||
type VersionGetter interface {
|
||||
Version24(ctx context.Context) (version string, err error)
|
||||
Version25(ctx context.Context) (version string, err error)
|
||||
}
|
||||
|
||||
func (c *configurator) Version24(ctx context.Context) (version string, err error) {
|
||||
return c.version(ctx, binOpenvpn24)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user