Upstream is an interface for a DNS resolver. All the methods must be safe for concurrent use.
| 31 | // Upstream is an interface for a DNS resolver. All the methods must be safe |
| 32 | // for concurrent use. |
| 33 | type 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. |
| 50 | type QUICTracer interface { |
no outgoing calls
no test coverage detected
searching dependent graphs…