Documentation
¶
Index ¶
- Variables
- type BottinResolver
- func (br *BottinResolver) Resolve(qname, qtype string) RRs
- func (br *BottinResolver) ResolveContext(ctx context.Context, qname, qtype string) (RRs, error)
- func (br *BottinResolver) ResolveCtx(ctx context.Context, qname, qtype string) (RRs, error)
- func (br *BottinResolver) ResolveErr(qname, qtype string) (RRs, error)
- type Cache
- type Option
- type RR
- type RRs
- type Resolver
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Timeout = 2000 * time.Millisecond TypicalResponseTime = 100 * time.Millisecond MaxRecursion = 10 MaxNameservers = 2 MaxIPs = 2 )
View Source
var ( NXDOMAIN = fmt.Errorf("NXDOMAIN") ErrMaxRecursion = fmt.Errorf("maximum recursion depth reached: %d", MaxRecursion) ErrMaxIPs = fmt.Errorf("maximum name server IPs queried: %d", MaxIPs) ErrNoARecords = fmt.Errorf("no A records found for name server") ErrNoResponse = fmt.Errorf("no responses received") ErrTimeout = fmt.Errorf("timeout expired") // TODO: Timeouter interface? e.g. func (e) Timeout() bool { return true } )
Resolver errors.
View Source
var DebugLogger io.Writer
DebugLogger will receive writes of DNS resolution traces if not nil.
Functions ¶
This section is empty.
Types ¶
type BottinResolver ¶
type BottinResolver struct {
// contains filtered or unexported fields
}
func New ¶
func New(cap int) *BottinResolver
func NewExpiring ¶
func NewExpiring(cap int) *BottinResolver
func NewExpiringWithTimeout ¶
func NewExpiringWithTimeout(cap int, timeout time.Duration) *BottinResolver
func NewResolver ¶
func NewResolver(options ...Option) *BottinResolver
func NewWithTimeout ¶
func NewWithTimeout(cap int, timeout time.Duration) *BottinResolver
func (*BottinResolver) Resolve ¶
func (br *BottinResolver) Resolve(qname, qtype string) RRs
func (*BottinResolver) ResolveContext ¶
func (*BottinResolver) ResolveCtx ¶
func (*BottinResolver) ResolveErr ¶
func (br *BottinResolver) ResolveErr(qname, qtype string) (RRs, error)
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache stores slices of RR structs, with each key mapping to an RR slice.
func NewCache ¶
func NewCache() *Cache
NewCache initializes a new cache for storing slices of RR structs.
type Option ¶
type Option func(*Resolver)
Option specifies a configuration option for a Resolver.
func WithDialer ¶
WithDialer sets a custom dialer for the Resolver.
func WithTCPRetry ¶
func WithTCPRetry() Option
func WithTimeout ¶
WithTimeout sets a timeout for the Resolver's operations.
Click to show internal directories.
Click to hide internal directories.