Documentation
¶
Overview ¶
Package resolver performs concurrent reverse DNS lookups with a per-run cache so the same IP is not resolved twice. Lookups are capped by their own timeout so a slow PTR server can't stall the scan pipeline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache resolves IPs to hostnames with dedupe and a single-flight-style barrier so concurrent callers for the same IP share one lookup.
type LookupFunc ¶
LookupFunc is the injectable resolver. Returning "" means "no name"; returning an error is distinct and is recorded for observability but otherwise treated the same as "no name" (callers render the IP).
type Options ¶
type Options struct {
// Lookup does the PTR query. If nil, net.DefaultResolver.LookupAddr
// is used.
Lookup LookupFunc
// Timeout per individual lookup. 0 → 2s.
Timeout time.Duration
}
Options tunes the cache.
Click to show internal directories.
Click to hide internal directories.