Compare commits

..

No commits in common. "master" and "v1.10.0" have entirely different histories.

View file

@ -220,24 +220,6 @@ type ObservationProvider interface {
Collect(ctx context.Context, opts CheckerOptions) (any, error) Collect(ctx context.Context, opts CheckerOptions) (any, error)
} }
// ObservationSharer is an optional interface an ObservationProvider can
// implement to declare that its observation depends only on a subset of the
// inputs and may therefore be shared across check targets.
//
// ShareKey returns a stable string derived purely from the inputs that affect
// the result (e.g. the sorted IP set + ping count). Two collections with the
// same ShareKey produce identical data; the host may serve one from the other.
// Return "" to opt out (the host falls back to per-target caching).
//
// ShareKey MUST be a pure function of opts: no network, no I/O. The host calls
// it before deciding whether to collect, possibly on the locally registered
// provider even when actual collection is delegated to a remote endpoint.
//
// Detect support with a type assertion: _, ok := provider.(ObservationSharer)
type ObservationSharer interface {
ShareKey(opts CheckerOptions) (string, error)
}
// CheckRuleInfo is the JSON-serializable description of a rule, for API/UI listing. // CheckRuleInfo is the JSON-serializable description of a rule, for API/UI listing.
type CheckRuleInfo struct { type CheckRuleInfo struct {
Name string `json:"name"` Name string `json:"name"`