2022-11-03 18:39:37 +01:00
|
|
|
package dns
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
2023-02-13 15:25:11 +01:00
|
|
|
|
|
|
|
"github.com/miekg/dns"
|
2022-11-03 18:39:37 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
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() {}
|