2021-09-09 21:24:27 +02:00
|
|
|
package mocks
|
|
|
|
|
2022-05-25 17:03:58 +02:00
|
|
|
//
|
|
|
|
// Mocks for model.DNSDecoder
|
|
|
|
//
|
2022-05-16 10:46:53 +02:00
|
|
|
|
2022-05-25 17:03:58 +02:00
|
|
|
import (
|
2022-05-14 19:38:46 +02:00
|
|
|
"github.com/ooni/probe-cli/v3/internal/model"
|
|
|
|
)
|
2021-09-27 23:09:41 +02:00
|
|
|
|
2022-05-25 17:03:58 +02:00
|
|
|
// DNSDecoder allows mocking model.DNSDecoder.
|
2021-09-28 10:47:59 +02:00
|
|
|
type DNSDecoder struct {
|
2022-05-25 17:03:58 +02:00
|
|
|
MockDecodeResponse func(data []byte, query model.DNSQuery) (model.DNSResponse, error)
|
2021-09-09 21:24:27 +02:00
|
|
|
}
|
|
|
|
|
2022-05-25 17:03:58 +02:00
|
|
|
var _ model.DNSDecoder = &DNSDecoder{}
|
2022-05-16 10:46:53 +02:00
|
|
|
|
2022-05-25 17:03:58 +02:00
|
|
|
func (e *DNSDecoder) DecodeResponse(data []byte, query model.DNSQuery) (model.DNSResponse, error) {
|
|
|
|
return e.MockDecodeResponse(data, query)
|
2021-09-09 21:24:27 +02:00
|
|
|
}
|