2021-09-09 21:24:27 +02:00
|
|
|
package mocks
|
|
|
|
|
2022-05-25 17:03:58 +02:00
|
|
|
//
|
|
|
|
// Mocks for model.DNSEncoder.
|
|
|
|
//
|
|
|
|
|
|
|
|
import "github.com/ooni/probe-cli/v3/internal/model"
|
|
|
|
|
|
|
|
// DNSEncoder allows mocking model.DNSEncoder.
|
2021-09-28 10:47:59 +02:00
|
|
|
type DNSEncoder struct {
|
2022-05-25 17:03:58 +02:00
|
|
|
MockEncode func(domain string, qtype uint16, padding bool) model.DNSQuery
|
2021-09-09 21:24:27 +02:00
|
|
|
}
|
|
|
|
|
2022-05-25 17:03:58 +02:00
|
|
|
var _ model.DNSEncoder = &DNSEncoder{}
|
|
|
|
|
2021-09-09 21:24:27 +02:00
|
|
|
// Encode calls MockEncode.
|
2022-05-25 17:03:58 +02:00
|
|
|
func (e *DNSEncoder) Encode(domain string, qtype uint16, padding bool) model.DNSQuery {
|
2021-09-09 21:24:27 +02:00
|
|
|
return e.MockEncode(domain, qtype, padding)
|
|
|
|
}
|