dig

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const ContentType = "application/dns-message"

Variables

View Source
var (
	DefaultResolvers          []string
	ErrPackMsg                = fmt.Errorf("failed to pack request dns message")
	ErrParseTarget            = fmt.Errorf("failed to parse target url")
	ErrCreateRequest          = fmt.Errorf("failed to create http post request")
	ErrRequest                = fmt.Errorf("failed to request")
	ErrUnsupportedContentType = fmt.Errorf("unsupported content type is received")
	ErrReadBody               = fmt.Errorf("failed to read body")
	ErrNotOK                  = fmt.Errorf("status code is not 200")
	ErrParseMsg               = fmt.Errorf("failed to parse DNS message")
)

Functions

func HTTPS

func HTTPS(m *dns.Msg, options ...Option) (*dns.Msg, error)

func Simple

func Simple(name string, qtype uint16, options ...Option) (*dns.Msg, error)

func TCP

func TCP(m *dns.Msg, options ...Option) (*dns.Msg, error)

func TLS

func TLS(m *dns.Msg, options ...Option) (*dns.Msg, error)

func UDP

func UDP(m *dns.Msg, options ...Option) (*dns.Msg, error)

Types

type Dig

type Dig struct {
	Client     *dns.Client
	HTTPClient *http.Client
	Target     string
}

func NewDig

func NewDig() *Dig

func (*Dig) Exchange

func (d *Dig) Exchange(m *dns.Msg, options ...Option) (*dns.Msg, error)

func (*Dig) ExchangeContext added in v1.4.2

func (d *Dig) ExchangeContext(ctx context.Context, m *dns.Msg, options ...Option) (*dns.Msg, error)

func (*Dig) ExchangeContextWithRTT added in v1.7.0

func (d *Dig) ExchangeContextWithRTT(ctx context.Context, m *dns.Msg, options ...Option) (*dns.Msg, time.Duration, error)

func (*Dig) ExchangeWithRTT added in v1.7.0

func (d *Dig) ExchangeWithRTT(m *dns.Msg, options ...Option) (*dns.Msg, time.Duration, error)

type Option added in v1.4.1

type Option interface {
	Option(*Dig) error
}

type OptionNet

type OptionNet struct {
	Net string
}

func (*OptionNet) Option

func (o *OptionNet) Option(c *Dig) error

type OptionTLSConfig

type OptionTLSConfig struct {
	TLSConfig *tls.Config
}

func (*OptionTLSConfig) Option

func (o *OptionTLSConfig) Option(c *Dig) error

type OptionTarget

type OptionTarget struct {
	Target string
}

func (*OptionTarget) Option

func (o *OptionTarget) Option(c *Dig) error

type ResolvInterface added in v1.4.1

type ResolvInterface interface {
	Exchange(*dns.Msg, ...Option) (*dns.Msg, error)
	ExchangeContext(context.Context, *dns.Msg, ...Option) (*dns.Msg, error)
}

Jump to

Keyboard shortcuts

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