MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / checkBaseline

Function checkBaseline

lib/workertypes/types.go:385–396  ·  view source on GitHub ↗
(change *v1.Change[v1.BaselineState], newlyCount, widelyCount *int)

Source from the content-addressed store, hash-verified

383}
384
385// SummaryVisitor defines the contract for consuming immutable Event Summaries.
386// Unlike state blobs which are migrated to the latest schema, summaries are
387// historical records that should be rendered as-is. The Visitor pattern forces
388// consumers to explicitly handle each schema version (e.g. V1, V2) independently.
389type SummaryVisitor interface {
390 VisitV1(s EventSummary) error
391}
392
393// ParseEventSummary handles the version detection and dispatching logic.
394// Consumers (like the Delivery Worker) should use this instead of raw json.Unmarshal.
395func ParseEventSummary(data []byte, v SummaryVisitor) error {
396 // 1. Peek at version
397 var header struct {
398 SchemaVersion string `json:"schemaVersion"`
399 }

Callers 1

generateCategoryDetailsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected