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

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
}