chore(updater): internal/updater/loop subpackage

- Do not export updater interface
- Export updater struct
- Define local interfaces where needed
- More restrictive updater loop interface in http control server
- Inject `Updater` into updater loop as an interface
This commit is contained in:
Quentin McGaw
2022-05-28 16:03:59 +00:00
parent 991d75a1d0
commit 292813831d
10 changed files with 45 additions and 51 deletions

View File

@@ -10,14 +10,13 @@ import (
"github.com/qdm12/gluetun/internal/models"
"github.com/qdm12/gluetun/internal/portforward"
"github.com/qdm12/gluetun/internal/publicip"
"github.com/qdm12/gluetun/internal/updater"
"github.com/qdm12/gluetun/internal/vpn"
)
func New(ctx context.Context, address string, logEnabled bool, logger Logger,
buildInfo models.BuildInformation, openvpnLooper vpn.Looper,
pfGetter portforward.Getter, unboundLooper dns.Looper,
updaterLooper updater.Looper, publicIPLooper publicip.Looper) (server httpserver.Runner, err error) {
updaterLooper UpdaterLooper, publicIPLooper publicip.Looper) (server httpserver.Runner, err error) {
handler := newHandler(ctx, logger, logEnabled, buildInfo,
openvpnLooper, pfGetter, unboundLooper, updaterLooper, publicIPLooper)