From d5a39c8aeb84ce7db12c1c8b2d7eecc9aebf7416 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Fri, 29 Nov 2024 02:10:57 +0100 Subject: [PATCH] doc(qa): better documentation of Event fields (#3) Clarify which fields are really DNS specific and which can instead be extended to other protocols in the future. Also, make sure we use `[]byte` rather than string for `RawQuery` and `RawResponse`. --- internal/qa/event.go | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/internal/qa/event.go b/internal/qa/event.go index 721b2a6..b5ff4d5 100644 --- a/internal/qa/event.go +++ b/internal/qa/event.go @@ -95,16 +95,26 @@ type Event struct { // DNS-specific fields // - // RawQuery is the raw DNS query message. - RawQuery string `json:"rawQuery,omitempty"` + // RawQuery contains the raw DNS query message. + RawQuery []byte `json:"rawQuery,omitempty"` - // RawResponse is the raw DNS response message. - RawResponse string `json:"rawResponse,omitempty"` + // RawResponse contains the raw DNS response message. + RawResponse []byte `json:"rawResponse,omitempty"` - // ServerAddr is the DNS server address. + // + // Server-specific fields + // + + // ServerAddr is the server address. + // + // This field is currently used for DNS but may be extended + // to other applicative protocols in the future. ServerAddr string `json:"serverAddr,omitempty"` - // ServerProtocol is the DNS server protocol. + // ServerProtocol is the server protocol. + // + // This field is currently used for DNS but may be extended + // to other applicative protocols in the future. ServerProtocol string `json:"serverProtocol,omitempty"` //