Documentation ¶
Overview ¶
Package dnscache contains a minimal DNS cache that makes a bunch of assumptions that are only valid for us. Not recommended for general use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DialContextFunc ¶ added in v1.4.0
func Dialer ¶ added in v1.4.0
func Dialer(fwd DialContextFunc, dnsCache *Resolver) DialContextFunc
Dialer returns a wrapped DialContext func that uses the provided dnsCache.
type Resolver ¶
type Resolver struct { // Forward is the resolver to use to populate the cache. // If nil, net.DefaultResolver is used. Forward *net.Resolver // TTL is how long to keep entries cached // // If zero, a default (currently 10 minutes) is used. TTL time.Duration // UseLastGood controls whether a cached entry older than TTL is used // if a refresh fails. UseLastGood bool // contains filtered or unexported fields }
Resolver is a minimal DNS caching resolver.
The TTL is always fixed for now. It's not intended for general use. Cache entries are never cleaned up so it's intended that this is only used with a fixed set of hostnames.
Click to show internal directories.
Click to hide internal directories.