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
commit b5826a0c44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 9 deletions

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,