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

Interface Upstream

upstream/upstream.go:33–47  ·  view source on GitHub ↗

Upstream is an interface for a DNS resolver. All the methods must be safe for concurrent use.

Source from the content-addressed store, hash-verified

31// Upstream is an interface for a DNS resolver. All the methods must be safe
32// for concurrent use.
33type Upstream interface {
34 // Exchange sends req to this upstream and returns the response that has
35 // been received or an error if something went wrong. The implementations
36 // must not modify req as well as the caller must not modify it until the
37 // method returns. It shouldn't be called after closing. req must not be
38 // nil.
39 Exchange(req *dns.Msg) (resp *dns.Msg, err error)
40
41 // Address returns the human-readable address of the upstream DNS resolver.
42 // It may differ from what was passed to [AddressToUpstream].
43 Address() (addr string)
44
45 // Closer used to close the upstreams properly.
46 io.Closer
47}
48
49// QUICTracer creates [qlogwriter.Trace] instances for QUIC connection tracing.
50type QUICTracer interface {

Implementers 11

dnsCryptupstream/dnscrypt.go
dnsOverQUICupstream/doq.go
dnsOverHTTPSupstream/doh.go
dnsOverTLSupstream/dot.go
plainDNSupstream/plain.go
testUpstreamupstream/parallel_internal_test.go
upstreamWithStatsproxy/stats.go
testUpstreamproxy/proxy_internal_test.go
Upstreaminternal/dnsproxytest/interface.go
errUpstreamfastip/fastest_internal_test.go
testAUpstreamfastip/fastest_internal_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…