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 is a signature migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
aae1452e12
commit
df4a7a89d1
9 changed files with 480 additions and 32 deletions
|
|
@ -4,14 +4,19 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
sdk "git.happydns.org/checker-sdk-go/checker"
|
||||
|
||||
"git.happydns.org/checker-dav/internal/dav"
|
||||
)
|
||||
|
||||
func (p *carddavProvider) GetHTMLReport(raw json.RawMessage) (string, error) {
|
||||
// GetHTMLReport folds downstream TLS probes (published on our discovered
|
||||
// endpoints) into the CardDAV report via ctx.Related — see the CalDAV
|
||||
// sibling for the rationale.
|
||||
func (p *carddavProvider) GetHTMLReport(ctx sdk.ReportContext) (string, error) {
|
||||
var d dav.Observation
|
||||
if err := json.Unmarshal(raw, &d); err != nil {
|
||||
if err := json.Unmarshal(ctx.Data(), &d); err != nil {
|
||||
return "", fmt.Errorf("failed to unmarshal carddav report: %w", err)
|
||||
}
|
||||
d.Kind = dav.KindCardDAV
|
||||
return dav.RenderReport(&d, "CardDAV Server")
|
||||
return dav.RenderReport(&d, "CardDAV Server", ctx.Related(dav.TLSRelatedKey))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue