Maint: package local narrow Logger interfaces

This commit is contained in:
Quentin McGaw (desktop)
2021-09-23 16:58:21 +00:00
parent d8e008606f
commit cf95692b93
57 changed files with 414 additions and 154 deletions

8
internal/dns/logger.go Normal file
View File

@@ -0,0 +1,8 @@
package dns
type Logger interface {
Debug(s string)
Info(s string)
Warn(s string)
Error(s string)
}

View File

@@ -13,7 +13,6 @@ import (
"github.com/qdm12/gluetun/internal/dns/state"
"github.com/qdm12/gluetun/internal/loopstate"
"github.com/qdm12/gluetun/internal/models"
"github.com/qdm12/golibs/logging"
)
var _ Looper = (*Loop)(nil)
@@ -33,7 +32,7 @@ type Loop struct {
resolvConf string
blockBuilder blacklist.Builder
client *http.Client
logger logging.Logger
logger Logger
userTrigger bool
start <-chan struct{}
running chan<- models.LoopStatus
@@ -48,7 +47,7 @@ type Loop struct {
const defaultBackoffTime = 10 * time.Second
func NewLoop(conf unbound.Configurator, settings configuration.DNS, client *http.Client,
logger logging.Logger) *Loop {
logger Logger) *Loop {
start := make(chan struct{})
running := make(chan models.LoopStatus)
stop := make(chan struct{})