Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultTimeout = 100 * time.Millisecond
DefaultTimeout is the duration waited until a DNS query expires.
View Source
const RcodeNoResponse int = 50
RcodeNoResponse is a special status code used to indicate no response or package error.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Nameserver ¶
type Nameserver interface {
Address() *net.UDPAddr
XchgManager() XchgManager
RateMonitor() RateTrack
SendRequest(ctx context.Context, req Request, conns Conn) error
RequestResponse(resp *dns.Msg, at time.Time)
NsecTraversal(ctx context.Context, domain string, conns Conn) ([]*dns.NSEC, error)
Close()
}
type Request ¶
type Request interface {
Server() Nameserver
SetServer(s Nameserver)
SentAt() time.Time
SetSentAt(t time.Time)
Message() *dns.Msg
SendResponse(resp *dns.Msg)
NoResponse()
Release()
}
type Selector ¶
type Selector interface {
// Get returns a nameserverr managed by the selector.
Get(fqdn string) (Nameserver, error)
// Lookup returns the nameserver with the matching address.
Lookup(addr string) (Nameserver, error)
// All returns all the nameservers currently managed by the selector.
All() []Nameserver
// Close releases all resources allocated by the selector.
Close()
}
type XchgManager ¶
type XchgManager interface {
Add(req Request) error
Modify(id uint16, name string, callback func(req Request)) error
Remove(id uint16, name string) (Request, bool)
RemoveExpired(timeout time.Duration) []Request
RemoveAll() []Request
Delete(keys []string) []Request
}
XchgManager handles DNS message IDs and identifying messages that have timed out.
Click to show internal directories.
Click to hide internal directories.