From fb483b70bd6b02eb3bc673305556fafa20500400 Mon Sep 17 00:00:00 2001 From: grumbulon Date: Sat, 24 Sep 2022 19:02:08 -0400 Subject: [PATCH] re-add lost stuff in previous rebase --- go.sum | 4 ---- pkg/util/query.go | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/go.sum b/go.sum index 6ac42ef..a53af50 100644 --- a/go.sum +++ b/go.sum @@ -77,12 +77,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220924013350-4ba4fb4dd9e7 h1:WJywXQVIb56P2kAvXeMGTIgQ1ZHQxR60+F9dLsodECc= golang.org/x/crypto v0.0.0-20220924013350-4ba4fb4dd9e7/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20220914170420-dc92f8653013 h1:ZjglnWxEUdPyXl4o/j4T89SRCI+4X6NW6185PNLEOF4= -golang.org/x/exp v0.0.0-20220914170420-dc92f8653013/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= golang.org/x/exp v0.0.0-20220921164117-439092de6870 h1:j8b6j9gzSigH28O5SjSpQSSh9lFd6f5D/q0aHjNTulc= golang.org/x/exp v0.0.0-20220921164117-439092de6870/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= diff --git a/pkg/util/query.go b/pkg/util/query.go index 79f2dbf..8e1dd72 100644 --- a/pkg/util/query.go +++ b/pkg/util/query.go @@ -13,23 +13,23 @@ 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"` + RTT time.Duration `json:"rtt" example:"2000000000"` } // 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"` + // 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"` + Timeout time.Duration `json:"timeout" example:"2000000000"` // Port to make DNS request on - Port int `json:"port"` + Port int `json:"port" example:"53"` // Number of failures to make before giving up - Retries int `json:"retries"` + Retries int `json:"retries" example:"2"` // Request type, eg. A, AAAA, NAPTR - Type uint16 `json:"type"` + Type uint16 `json:"type" example:"1"` // Request class, eg. IN - Class uint16 `json:"class"` + Class uint16 `json:"class" example:"1"` }