resolver

package
v3.15.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BogonResolver

type BogonResolver struct {
	model.Resolver
}

BogonResolver is a bogon aware resolver. When a bogon is encountered in a reply, this resolver will return an error.

Deprecation warning

This resolver is deprecated. The right thing to do would be to check for bogons right after a domain name resolution in the nettest.

func (BogonResolver) LookupHost

func (r BogonResolver) LookupHost(ctx context.Context, hostname string) ([]string, error)

LookupHost implements Resolver.LookupHost

type CacheResolver

type CacheResolver struct {
	ReadOnly bool
	model.Resolver
	// contains filtered or unexported fields
}

CacheResolver is a resolver that caches successful replies.

func (*CacheResolver) Get

func (r *CacheResolver) Get(domain string) []string

Get gets the currently configured entry for domain, or nil

func (*CacheResolver) LookupHost

func (r *CacheResolver) LookupHost(
	ctx context.Context, hostname string) ([]string, error)

LookupHost implements Resolver.LookupHost

func (*CacheResolver) Set

func (r *CacheResolver) Set(domain string, addresses []string)

Set allows to pre-populate the cache

type SaverDNSTransport

type SaverDNSTransport struct {
	model.DNSTransport
	Saver *trace.Saver
}

SaverDNSTransport is a DNS transport that saves events

func (SaverDNSTransport) RoundTrip

func (txp SaverDNSTransport) RoundTrip(ctx context.Context, query []byte) ([]byte, error)

RoundTrip implements RoundTripper.RoundTrip

type SaverResolver

type SaverResolver struct {
	model.Resolver
	Saver *trace.Saver
}

SaverResolver is a resolver that saves events

func (SaverResolver) LookupHost

func (r SaverResolver) LookupHost(ctx context.Context, hostname string) ([]string, error)

LookupHost implements Resolver.LookupHost

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL