awl/util/query.go
Sam Therapy b9abedfca2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
API work
Signed-off-by: Sam Therapy <sam@samtherapy.net>
2022-09-13 03:04:45 +02:00

36 lines
834 B
Go

// SPDX-License-Identifier: BSD-3-Clause
package util
import (
"time"
"github.com/miekg/dns"
)
// Response is the DNS response.
type Response struct {
// The full DNS response
DNS *dns.Msg `json:"response"`
// The time it took to make the DNS query
RTT time.Duration `json:"rtt"`
}
// Request is a structure for a DNS query.
type Request struct {
// Server to query, eg. 8.8.8.8
Server string `json:"server"`
// Domain to query, eg. example.com
Name string `json:"name"`
// Duration to wait until marking request as failed
Timeout time.Duration `json:"timeout"`
// Port to make DNS request on
Port int `json:"port"`
// Number of failures to make before giving up
Retries int `json:"retries"`
// Request type, eg. A, AAAA, NAPTR
Type uint16 `json:"type"`
// Request class, eg. IN
Class uint16 `json:"class"`
}