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:
nemunaire 2026-04-19 23:36:04 +07:00
commit 48785e2896

View file

@ -53,9 +53,9 @@ func (p *pingProvider) Definition() *happydns.CheckerDefinition {
}
// ExtractMetrics implements happydns.CheckerMetricsReporter.
func (p *pingProvider) ExtractMetrics(raw json.RawMessage, collectedAt time.Time) ([]happydns.CheckMetric, error) {
func (p *pingProvider) ExtractMetrics(ctx happydns.ReportContext, collectedAt time.Time) ([]happydns.CheckMetric, error) {
var data PingData
if err := json.Unmarshal(raw, &data); err != nil {
if err := json.Unmarshal(ctx.Data(), &data); err != nil {
return nil, err
}