refactor(jafar): remove unnecessary dep on netx (#497)

This commit is contained in:
Simone Basso
2021-09-09 18:01:20 +02:00
committed by GitHub
parent 1d79d70b43
commit b5826a0c44
4 changed files with 13 additions and 9 deletions
+6 -2
View File
@@ -9,9 +9,13 @@ import (
"strings"
"github.com/miekg/dns"
"github.com/ooni/probe-cli/v3/internal/engine/netx"
)
// Resolver resolves domain names.
type Resolver interface {
LookupHost(ctx context.Context, hostname string) ([]string, error)
}
// CensoringResolver is a censoring resolver.
type CensoringResolver struct {
blocked []string
@@ -27,7 +31,7 @@ type CensoringResolver struct {
// and TLS proxies will pick them up. dnsNetwork and dnsAddress are the
// settings to configure the upstream, non censored DNS.
func NewCensoringResolver(
blocked, hijacked, ignored []string, uncensored netx.Resolver,
blocked, hijacked, ignored []string, uncensored Resolver,
) *CensoringResolver {
return &CensoringResolver{
blocked: blocked,