Initial commit

This commit is contained in:
nemunaire 2026-04-26 17:23:08 +07:00
commit 66cf1fc9aa
30 changed files with 2735 additions and 0 deletions

View file

@ -0,0 +1,26 @@
package checker
import (
"encoding/json"
"testing"
sdk "git.happydns.org/checker-sdk-go/checker"
)
// staticCtx is a minimal sdk.ReportContext used by report tests.
type staticCtx struct {
data json.RawMessage
}
func (s staticCtx) Data() json.RawMessage { return s.data }
func (staticCtx) Related(sdk.ObservationKey) []sdk.RelatedObservation { return nil }
func (staticCtx) States() []sdk.CheckState { return nil }
func jsonOf(t *testing.T, v any) []byte {
t.Helper()
b, err := json.Marshal(v)
if err != nil {
t.Fatalf("marshal: %v", err)
}
return b
}