Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v0.4.0
func WithCacheDisabled ¶ added in v0.4.0
func WithCacheDisabled() Option
func WithMaxCacheTTL ¶ added in v0.4.0
Specifies the maximum time entries are valid in the cache A maxCacheTTL of zero or less is equivalent to `WithCacheDisabled`
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func (*Resolver) LookupIPAddr ¶
func (*Resolver) LookupTXTWithTTL ¶ added in v0.6.0
func (r *Resolver) LookupTXTWithTTL(ctx context.Context, domain string) ([]string, time.Duration, error)
LookupTXTWithTTL is like Resolver.LookupTXT but also returns how long the TXT records may be cached. The TTL is the smallest Ttl across the answer's TXT resource records, capped by the resolver's max cache TTL (WithMaxCacheTTL). On a cache hit it is the remaining lifetime of the cached entry, so the value shrinks as the entry ages. A TTL of 0 means the records may not be cached: because the cache is disabled (WithCacheDisabled), the records themselves carry a TTL of 0, or the upstream resolver did not provide one.