plugin/forward: add HealthChecker interface (#1950)
* plugin/forward: add HealthChecker interface Make the HealthChecker interface and morph the current DNS health checker into that interface. Remove all whole bunch of method on Forward that didn't make sense. This is done in preparation of adding a DoH client to forward - which requires a completely different healthcheck implementation (and more, but lets start here) Signed-off-by: Miek Gieben <miek@miek.nl> * Use protocol Signed-off-by: Miek Gieben <miek@miek.nl> * Dial doesnt need to be method an Forward either Signed-off-by: Miek Gieben <miek@miek.nl> * Address comments Address various comments on the PR. Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
parent
4083852b70
commit
a536833546
13 changed files with 77 additions and 76 deletions
|
@ -17,7 +17,7 @@ func TestCached(t *testing.T) {
|
|||
})
|
||||
defer s.Close()
|
||||
|
||||
tr := newTransport(s.Addr, nil /* no TLS */)
|
||||
tr := newTransport(s.Addr)
|
||||
tr.Start()
|
||||
defer tr.Stop()
|
||||
|
||||
|
@ -56,7 +56,7 @@ func TestCleanupByTimer(t *testing.T) {
|
|||
})
|
||||
defer s.Close()
|
||||
|
||||
tr := newTransport(s.Addr, nil /* no TLS */)
|
||||
tr := newTransport(s.Addr)
|
||||
tr.SetExpire(100 * time.Millisecond)
|
||||
tr.Start()
|
||||
defer tr.Stop()
|
||||
|
@ -90,7 +90,7 @@ func TestPartialCleanup(t *testing.T) {
|
|||
})
|
||||
defer s.Close()
|
||||
|
||||
tr := newTransport(s.Addr, nil /* no TLS */)
|
||||
tr := newTransport(s.Addr)
|
||||
tr.SetExpire(100 * time.Millisecond)
|
||||
tr.Start()
|
||||
defer tr.Stop()
|
||||
|
@ -138,7 +138,7 @@ func TestCleanupAll(t *testing.T) {
|
|||
})
|
||||
defer s.Close()
|
||||
|
||||
tr := newTransport(s.Addr, nil /* no TLS */)
|
||||
tr := newTransport(s.Addr)
|
||||
|
||||
c1, _ := dns.DialTimeout("udp", tr.addr, defaultDialTimeout)
|
||||
c2, _ := dns.DialTimeout("udp", tr.addr, defaultDialTimeout)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue