Enforce prober/evaluator boundary in ObservationData
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a0dcac59bd
commit
0903357221
1 changed files with 5 additions and 7 deletions
|
|
@ -3,6 +3,7 @@ package checker
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"slices"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
|
@ -77,10 +78,8 @@ type NSResult struct {
|
|||
// Dedupes identical messages and caps the list with a sentinel summary.
|
||||
func (n *NSResult) appendError(format string, args ...any) {
|
||||
msg := fmt.Sprintf(format, args...)
|
||||
for _, e := range n.Errors {
|
||||
if e == msg {
|
||||
return
|
||||
}
|
||||
if slices.Contains(n.Errors, msg) {
|
||||
return
|
||||
}
|
||||
if len(n.Errors) >= maxNSResultErrors {
|
||||
n.suppressedErrors++
|
||||
|
|
@ -106,9 +105,8 @@ type ObservationData struct {
|
|||
ParentNS []string `json:"parent_ns,omitempty"`
|
||||
ParentQueryError string `json:"parent_query_error,omitempty"`
|
||||
// Union of DeclaredNS and ParentNS, de-duplicated.
|
||||
Probed []string `json:"probed,omitempty"`
|
||||
Results map[string]*NSResult `json:"results,omitempty"`
|
||||
Findings []Finding `json:"findings"`
|
||||
Probed []string `json:"probed,omitempty"`
|
||||
Results map[string]*NSResult `json:"results,omitempty"`
|
||||
}
|
||||
|
||||
// Local mirror of happyDomain's services/abstract.Origin. Duplicated on
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue