mirror of
https://github.com/TwiN/gatus.git
synced 2024-12-23 07:09:52 +01:00
Review changes
This commit is contained in:
parent
1fb2635226
commit
8789a4ad55
@ -22,10 +22,10 @@ const (
|
||||
// Values that could replace the placeholder: 127.0.0.1, 10.0.0.1, ...
|
||||
IPPlaceholder = "[IP]"
|
||||
|
||||
// DNSRCodePlaceHolder is a place holder for DNS_RCODE
|
||||
// DNSRCodePlaceholder is a place holder for DNS_RCODE
|
||||
//
|
||||
// Values that could be NOERROR, FORMERR, SERVFAIL, NXDOMAIN, NOTIMP and REFUSED
|
||||
DNSRCodePlaceHolder = "[DNS_RCODE]"
|
||||
DNSRCodePlaceholder = "[DNS_RCODE]"
|
||||
|
||||
// ResponseTimePlaceholder is a placeholder for the request response time, in milliseconds.
|
||||
//
|
||||
@ -152,7 +152,7 @@ func sanitizeAndResolve(list []string, result *Result) []string {
|
||||
element = strconv.Itoa(int(result.Duration.Milliseconds()))
|
||||
case BodyPlaceholder:
|
||||
element = body
|
||||
case DNSRCodePlaceHolder:
|
||||
case DNSRCodePlaceholder:
|
||||
element = result.DNSRCode
|
||||
case ConnectedPlaceholder:
|
||||
element = strconv.FormatBool(result.Connected)
|
||||
|
@ -84,7 +84,7 @@ func TestIntegrationQuery(t *testing.T) {
|
||||
t.Errorf("there should be errors")
|
||||
}
|
||||
if result.DNSRCode != test.expectedDNSCode {
|
||||
t.Errorf("DNSRCodePlaceHolder '%s' should have been %s", result.DNSRCode, test.expectedDNSCode)
|
||||
t.Errorf("DNSRCodePlaceholder '%s' should have been %s", result.DNSRCode, test.expectedDNSCode)
|
||||
}
|
||||
|
||||
if string(result.Body) != test.expectedBody {
|
||||
|
@ -19,8 +19,8 @@ type Result struct {
|
||||
// HTTPStatus is the HTTP response status code
|
||||
HTTPStatus int `json:"status"`
|
||||
|
||||
//
|
||||
DNSRCode string `json:"dnsr_code"`
|
||||
// DNSRCode is the response code of DNS query in human readable version
|
||||
DNSRCode string `json:"dns-rcode"`
|
||||
|
||||
// Body is the response body
|
||||
Body []byte `json:"-"`
|
||||
|
Loading…
Reference in New Issue
Block a user