dnsCrypt implements the [Upstream] interface for the DNSCrypt protocol.
| 17 | |
| 18 | // dnsCrypt implements the [Upstream] interface for the DNSCrypt protocol. |
| 19 | type dnsCrypt struct { |
| 20 | // mu protects client and serverInfo. |
| 21 | mu *sync.RWMutex |
| 22 | |
| 23 | // client stores the DNSCrypt client properties. |
| 24 | client *dnscrypt.Client |
| 25 | |
| 26 | // resolverInfo stores the DNSCrypt server properties. |
| 27 | resolverInfo *dnscrypt.ResolverInfo |
| 28 | |
| 29 | // addr is the DNSCrypt server URL. |
| 30 | addr *url.URL |
| 31 | |
| 32 | // logger is used for exchange logging. It is never nil. |
| 33 | logger *slog.Logger |
| 34 | |
| 35 | // verifyCert is a callback that verifies the resolver's certificate. |
| 36 | verifyCert func(cert *dnscrypt.Certificate) (err error) |
| 37 | |
| 38 | // timeout is the timeout for the DNS requests. |
| 39 | timeout time.Duration |
| 40 | } |
| 41 | |
| 42 | // newDNSCrypt returns a new DNSCrypt Upstream. |
| 43 | func newDNSCrypt(addr *url.URL, opts *Options) (u *dnsCrypt) { |
nothing calls this directly
no outgoing calls
no test coverage detected