MCPcopy
hub / github.com/AdguardTeam/dnsproxy / Resolver

Interface Resolver

internal/bootstrap/resolver.go:16–21  ·  view source on GitHub ↗

Resolver resolves the hostnames to IP addresses. Note, that [net.Resolver] from standard library also implements this interface.

Source from the content-addressed store, hash-verified

14// Resolver resolves the hostnames to IP addresses. Note, that [net.Resolver]
15// from standard library also implements this interface.
16type Resolver interface {
17 // LookupNetIP looks up the IP addresses for the given host. network should
18 // be one of [NetworkIP], [NetworkIP4] or [NetworkIP6]. The response may be
19 // empty even if err is nil. All the addrs must be valid.
20 LookupNetIP(ctx context.Context, network Network, host string) (addrs []netip.Addr, err error)
21}
22
23// type check
24var _ Resolver = (*net.Resolver)(nil)

Callers 7

TestLookupNetIPFunction · 0.65
ResolveDialContextFunction · 0.65
TestLookupParallelFunction · 0.65
LookupNetIPMethod · 0.65
lookupAsyncFunction · 0.65
LookupNetIPMethod · 0.65

Implementers 5

CachingResolverupstream/resolver.go
UpstreamResolverupstream/resolver.go
HostsResolverupstream/hostsresolver.go
Proxyproxy/proxy.go
testResolverinternal/bootstrap/resolver_test.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…