resolver

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DhcpResolveTimeout = 3 * time.Second
)
View Source
var (
	DnsDefaultTimeout = 5 * time.Second
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Exchange(m *D.Msg) (msg *D.Msg, err error)
	ExchangeContext(ctx context.Context, m *D.Msg) (msg *D.Msg, err error)
	Nameservers() []string
}

func NewClient

func NewClient(namesever string, boostNameserver string, dohCb func(dohRemoteIp string)) (Client, error)

type DohClient

type DohClient struct {
	// contains filtered or unexported fields
}

func NewDoHClient

func NewDoHClient(url string, boostNameserver string, cb func(dohRemoteIp string)) *DohClient

func (*DohClient) Exchange

func (dc *DohClient) Exchange(m *D.Msg) (msg *D.Msg, err error)

func (*DohClient) ExchangeContext

func (dc *DohClient) ExchangeContext(ctx context.Context, m *D.Msg) (msg *D.Msg, err error)

func (*DohClient) Nameservers

func (dc *DohClient) Nameservers() []string

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func NewResolver

func NewResolver(nameservers []net.IP) Resolver

func (Resolver) Exchange

func (r Resolver) Exchange(m *dns.Msg) (*dns.Msg, error)

func (Resolver) ExchangeContext

func (r Resolver) ExchangeContext(ctx context.Context, m *dns.Msg) (*dns.Msg, error)

func (Resolver) Nameservers

func (r Resolver) Nameservers() []string

type Result

type Result struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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