Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTimeout = errors.New("request timed out")
)
Functions ¶
This section is empty.
Types ¶
type AnyResolver ¶
type AnyResolver interface {
LookupAddr(ctx context.Context, addr string) (names []string, err error)
}
AnyResolver is for the net.Resolver
type RDNSCache ¶ added in v0.0.12
type RDNSCache struct { Resolver AnyResolver // contains filtered or unexported fields }
RDNSCache is safe to use across multiple goroutines. if multiple goroutines request the same IP at the same time, one of the requests will trigger the lookup and the rest will wait for its response.
func NewReverseDNSCache ¶
func (*RDNSCache) Lookup ¶ added in v0.0.12
Lookup takes a string representing a parseable ipv4 or ipv6 IP, and blocks until it has resolved to 0-n results, or until its lookup timeout has elapsed. if the lookup timeout elapses, it returns an empty slice.
func (*RDNSCache) Stats ¶ added in v0.0.12
func (d *RDNSCache) Stats() RDNSCacheStats
type RDNSCacheStats ¶
type ReverseDNS ¶
type ReverseDNS struct { Lookups []lookupEntry `toml:"lookup"` CacheTTL config.Duration `toml:"cache_ttl"` LookupTimeout config.Duration `toml:"lookup_timeout"` MaxParallelLookups int `toml:"max_parallel_lookups"` Ordered bool `toml:"ordered"` Log cua.Logger `toml:"-"` // contains filtered or unexported fields }
func (*ReverseDNS) Add ¶
func (r *ReverseDNS) Add(metric cua.Metric, acc cua.Accumulator) error
func (*ReverseDNS) Description ¶
func (r *ReverseDNS) Description() string
func (*ReverseDNS) SampleConfig ¶
func (r *ReverseDNS) SampleConfig() string
func (*ReverseDNS) Start ¶
func (r *ReverseDNS) Start(acc cua.Accumulator) error
func (*ReverseDNS) Stop ¶
func (r *ReverseDNS) Stop() error
Click to show internal directories.
Click to hide internal directories.