checker: adopt unified ReportContext reporter signature
Follow the checker-sdk-go interface consolidation: reporter methods now take sdk.ReportContext and read the payload via ctx.Data() instead of the raw json.RawMessage parameter. Backed by the same underlying logic.
This commit is contained in:
parent
979757b5a8
commit
c78ce034fc
1 changed files with 4 additions and 2 deletions
|
|
@ -6,6 +6,8 @@ import (
|
||||||
"html/template"
|
"html/template"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
sdk "git.happydns.org/checker-sdk-go/checker"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── HTML report ───────────────────────────────────────────────────────────────
|
// ── HTML report ───────────────────────────────────────────────────────────────
|
||||||
|
|
@ -197,9 +199,9 @@ details[open] > summary::before { transform: rotate(90deg); }
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetHTMLReport implements sdk.CheckerHTMLReporter.
|
// GetHTMLReport implements sdk.CheckerHTMLReporter.
|
||||||
func (p *zonemasterProvider) GetHTMLReport(raw json.RawMessage) (string, error) {
|
func (p *zonemasterProvider) GetHTMLReport(ctx sdk.ReportContext) (string, error) {
|
||||||
var data ZonemasterData
|
var data ZonemasterData
|
||||||
if err := json.Unmarshal(raw, &data); err != nil {
|
if err := json.Unmarshal(ctx.Data(), &data); err != nil {
|
||||||
return "", fmt.Errorf("failed to unmarshal zonemaster results: %w", err)
|
return "", fmt.Errorf("failed to unmarshal zonemaster results: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue