mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-23 08:33:45 +01:00
eb45310c8f
* Disable upstream DNS resolver after several tries and fails * Add tests for upstream fails * Use an extra flag to disable domains in DNS upstreams * Fix hashing IPs of nameservers for updates.
27 lines
747 B
Go
27 lines
747 B
Go
package dns
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/miekg/dns"
|
|
)
|
|
|
|
type mockResponseWriter struct {
|
|
WriteMsgFunc func(m *dns.Msg) error
|
|
}
|
|
|
|
func (rw *mockResponseWriter) WriteMsg(m *dns.Msg) error {
|
|
if rw.WriteMsgFunc != nil {
|
|
return rw.WriteMsgFunc(m)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (rw *mockResponseWriter) LocalAddr() net.Addr { return nil }
|
|
func (rw *mockResponseWriter) RemoteAddr() net.Addr { return nil }
|
|
func (rw *mockResponseWriter) Write([]byte) (int, error) { return 0, nil }
|
|
func (rw *mockResponseWriter) Close() error { return nil }
|
|
func (rw *mockResponseWriter) TsigStatus() error { return nil }
|
|
func (rw *mockResponseWriter) TsigTimersOnly(bool) {}
|
|
func (rw *mockResponseWriter) Hijack() {}
|