dns

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

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

First two records from the response decoded by the probe, if they are TXT or SOA; other RR can be decoded from "abuf"

func (*Answer) Mname

func (a *Answer) Mname() string

If the type is "SOA" this will have the original or primary domain name.

func (*Answer) Name

func (a *Answer) Name() string

Domain name.

func (*Answer) Rdata

func (a *Answer) Rdata() []string

If the type is "TXT" this will have the value of that record.

func (*Answer) Rname

func (a *Answer) Rname() string

If the type is "SOA" this will have the mailbox.

func (*Answer) Serial

func (a *Answer) Serial() int

If the type is "SOA" this will have the zone serial number.

func (*Answer) Ttl

func (a *Answer) Ttl() int

If the type is "SOA" this will have the time to live.

func (*Answer) Type

func (a *Answer) Type() string

Resource record type ("SOA" or "TXT").

func (*Answer) UnmarshalJSON

func (a *Answer) UnmarshalJSON(b []byte) error

type Error

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

Error message.

func (*Error) Getaddrinfo

func (e *Error) Getaddrinfo() string

Error message.

func (*Error) Timeout

func (e *Error) Timeout() int

Query timeout.

func (*Error) UnmarshalJSON

func (e *Error) UnmarshalJSON(b []byte) error

type Result

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

Response from the DNS server.

func (*Result) Abuf

func (r *Result) Abuf() string

Answer payload buffer from the server, UU encoded.

func (*Result) Ancount

func (r *Result) Ancount() int

Answer count.

func (*Result) Answers

func (r *Result) Answers() []*Answer

First two records from the response decoded by the probe, if they are TXT or SOA; other RR can be decoded from Abuf() using UnpackAbuf().

func (*Result) Arcount

func (r *Result) Arcount() int

Additional record count.

func (*Result) Id

func (r *Result) Id() int

Query ID.

func (*Result) Nscount

func (r *Result) Nscount() int

Name server count.

func (*Result) Qdcount

func (r *Result) Qdcount() int

Number of queries.

func (*Result) Rt

func (r *Result) Rt() float64

Response time in milli seconds (optional).

func (*Result) Size

func (r *Result) Size() int

Response size (optional).

func (*Result) SrcAddr

func (r *Result) SrcAddr() string

The source IP address added by the probe (optional).

func (*Result) Subid

func (r *Result) Subid() int

Sequence number of this result within a group of results, available if the resolution is done by the probe's local resolver (optional).

func (*Result) Submax

func (r *Result) Submax() int

Total number of results within a group (optional).

func (*Result) UnmarshalJSON

func (r *Result) UnmarshalJSON(b []byte) error

func (*Result) UnpackAbuf

func (r *Result) UnpackAbuf() (*mdns.Msg, error)

Decode the Abuf(), returns a *Msg from the github.com/miekg/dns package or nil on error or if Abuf() is empty.

type Resultset

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

func (*Resultset) Af

func (r *Resultset) Af() int

IP version: "4" or "6" (optional).

func (*Resultset) DnsError

func (r *Resultset) DnsError() *Error

DNS error message, nil if not present.

func (*Resultset) DstAddr

func (r *Resultset) DstAddr() string

IP address of the destination (optional).

func (*Resultset) DstName

func (r *Resultset) DstName() string

Hostname of the destination (optional).

func (*Resultset) Lts

func (r *Resultset) Lts() int

Last time synchronised. How long ago (in seconds) the clock of the probe was found to be in sync with that of a controller. The value -1 is used to indicate that the probe does not know whether it is in sync.

func (*Resultset) Proto

func (r *Resultset) Proto() string

Protocol, "TCP" or "UDP".

func (*Resultset) Qbuf

func (r *Resultset) Qbuf() string

Query payload buffer which was sent to the server, UU encoded (optional).

func (*Resultset) Result

func (r *Resultset) Result() *Result

DNS response from the DNS server, nil if not present.

func (*Resultset) Retry

func (r *Resultset) Retry() int

Retry count (optional).

func (*Resultset) Timestamp

func (r *Resultset) Timestamp() int

Start time, in Unix timestamp.

func (*Resultset) UnmarshalJSON

func (r *Resultset) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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