2021-09-09 21:24:27 +02:00
|
|
|
package mocks
|
|
|
|
|
2021-09-28 10:47:59 +02:00
|
|
|
// DNSEncoder allows mocking dnsx.DNSEncoder.
|
|
|
|
type DNSEncoder struct {
|
2022-05-14 19:38:46 +02:00
|
|
|
MockEncode func(domain string, qtype uint16, padding bool) ([]byte, uint16, error)
|
2021-09-09 21:24:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Encode calls MockEncode.
|
2022-05-14 19:38:46 +02:00
|
|
|
func (e *DNSEncoder) Encode(domain string, qtype uint16, padding bool) ([]byte, uint16, error) {
|
2021-09-09 21:24:27 +02:00
|
|
|
return e.MockEncode(domain, qtype, padding)
|
|
|
|
}
|