Documentation
¶
Index ¶
- Constants
- func NewNetResolver(opts ...Option) *net.Resolver
- type DialFunc
- type Option
- func MaxCacheEntries(n int) Option
- func MaxCacheTTL(td time.Duration) Option
- func Meter(m meter.Meter) Option
- func MinCacheTTL(td time.Duration) Option
- func NegativeCache(b bool) Option
- func PreferIPV4(b bool) Option
- func PreferIPV6(b bool) Option
- func Resolver(r *net.Resolver) Option
- func Timeout(td time.Duration) Option
- type Options
Constants ¶
View Source
const DefaultMaxCacheEntries = 300
Variables ¶
This section is empty.
Functions ¶
func NewNetResolver ¶
NewNetResolver creates a caching net.Resolver that uses parent to resolve names.
Types ¶
type DialFunc ¶
DialFunc is a net.Resolver.Dial function.
func NewNetDialer ¶
NewNetDialer adds caching to a net.Resolver.Dial function.
type Option ¶
type Option func(*Options)
A Option customizes the resolver cache.
func MaxCacheEntries ¶
MaxCacheEntries sets the maximum number of entries to cache. If zero, DefaultMaxCacheEntries is used; negative means no limit.
func MaxCacheTTL ¶
MaxCacheTTL sets the maximum time-to-live for entries in the cache.
func MinCacheTTL ¶
MinCacheTTL sets the minimum time-to-live for entries in the cache.
func NegativeCache ¶
NegativeCache sets whether to cache negative responses.
Click to show internal directories.
Click to hide internal directories.