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

@@ -9,7 +9,6 @@ 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"
)
@@ -18,7 +17,7 @@ func newHandler(ctx context.Context, logger infoWarner, logging bool,
vpnLooper vpn.Looper,
pfGetter portforward.Getter,
unboundLooper dns.Looper,
updaterLooper updater.Looper,
updaterLooper UpdaterLooper,
publicIPLooper publicip.Looper,
) http.Handler {
handler := &handler{}