awl/pkg/util/query.go
grumbulon 3a0a8f015a
All checks were successful
continuous-integration/drone/push Build is passing
chore(Refactor) (#110)
refactor

Co-authored-by: Sam Therapy <sam@samtherapy.net>
Reviewed-on: #110
Reviewed-by: Sam <sam@samtherapy.net>
2022-09-24 23:11:09 +00:00

35 lines
935 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" example:"2000000000"`
}
// Request is a structure for a DNS query.
type Request struct {
// Server to query
Server string `json:"server" example:"1.0.0.1"`
// Domain to query
Name string `json:"name" example:"example.com"`
// Duration to wait until marking request as failed
Timeout time.Duration `json:"timeout" example:"2000000000"`
// Port to make DNS request on
Port int `json:"port" example:"53"`
// Number of failures to make before giving up
Retries int `json:"retries" example:"2"`
// Request type, eg. A, AAAA, NAPTR
Type uint16 `json:"type" example:"1"`
// Request class, eg. IN
Class uint16 `json:"class" example:"1"`
}