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>
22 lines
665 B
Go
22 lines
665 B
Go
package carddav
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
|
|
sdk "git.happydns.org/checker-sdk-go/checker"
|
|
|
|
"git.happydns.org/checker-dav/internal/dav"
|
|
)
|
|
|
|
// 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(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", ctx.Related(dav.TLSRelatedKey))
|
|
}
|