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
2bb91d33d4
commit
df3d29f484
1 changed files with 4 additions and 2 deletions
|
|
@ -5,6 +5,8 @@ import (
|
|||
"fmt"
|
||||
"html/template"
|
||||
"strings"
|
||||
|
||||
sdk "git.happydns.org/checker-sdk-go/checker"
|
||||
)
|
||||
|
||||
// ── HTML report ───────────────────────────────────────────────────────────────
|
||||
|
|
@ -287,9 +289,9 @@ li { margin-bottom: .15rem; }
|
|||
)
|
||||
|
||||
// GetHTMLReport implements sdk.CheckerHTMLReporter.
|
||||
func (p *matrixProvider) GetHTMLReport(raw json.RawMessage) (string, error) {
|
||||
func (p *matrixProvider) GetHTMLReport(ctx sdk.ReportContext) (string, error) {
|
||||
var r MatrixFederationData
|
||||
if err := json.Unmarshal(raw, &r); err != nil {
|
||||
if err := json.Unmarshal(ctx.Data(), &r); err != nil {
|
||||
return "", fmt.Errorf("failed to unmarshal matrix report: %w", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue