feat: implement output formatting and display (HAN-383)
CI / test (pull_request) Failing after 2m2s

Add text and JSON formatters with real-time progress via traverser hooks,
summary statistics, and CLI integration for --show-* and --json flags.

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
Gary Hansen
2026-06-08 02:21:13 +10:00
co-authored by multica-agent
parent 876542b2de
commit 5a54834c5f
13 changed files with 1359 additions and 180 deletions
+32 -1
View File
@@ -1,6 +1,11 @@
package dns
import "github.com/miekg/dns"
import (
"fmt"
"strings"
"github.com/miekg/dns"
)
const (
TypeA uint16 = dns.TypeA
@@ -35,6 +40,32 @@ func QNameType(qtype uint16) string {
return dns.TypeToString[qtype]
}
func ParseQueryType(s string) (uint16, error) {
s = strings.ToUpper(strings.TrimSpace(s))
switch s {
case "A":
return TypeA, nil
case "AAAA":
return TypeAAAA, nil
case "NS":
return TypeNS, nil
case "CNAME":
return TypeCNAME, nil
case "MX":
return TypeMX, nil
case "TXT":
return TypeTXT, nil
case "SOA":
return TypeSOA, nil
case "PTR":
return TypePTR, nil
case "ANY":
return TypeANY, nil
default:
return 0, fmt.Errorf("invalid query type: %s", s)
}
}
func DefaultEDNS0UDPSize() int {
return 2048
}