Documentation
¶
Overview ¶
Package eventmatch provides the shared event-pattern matcher and JSONPath extraction used by both the event-trigger router (internal/trigger/event) and freshness arrival bindings (internal/freshness).
It lives in a leaf package (depending only on internal/models + stdlib) so freshness can reuse the exact matching and JSONPath semantics WITHOUT importing internal/trigger/event, which would create an import cycle:
internal/jobdef -> internal/freshness -> internal/trigger/event -> internal/job -> internal/jobdef/runtime -> internal/jobdef/git -> internal/jobdef
NOTE: internal/trigger/event still keeps its own private copies of these helpers (matcher.go + the resolveJSONPath family in event.go). This package mirrors them verbatim to avoid the cycle; a follow-up can collapse trigger/event onto this leaf (safe — importing a leaf creates no cycle). Keep the two in sync until then.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveJSONPathBytes ¶
ResolveJSONPathBytes extracts a scalar value from JSON bytes using the event trigger JSONPath subset ("$", "$.", dotted, and "[i]"). It is shared by arrival bindings so watermark paths follow the same behavior as event param mapping.
Types ¶
type EventPattern ¶
type EventPattern struct {
Type string `json:"type"`
Source string `json:"source,omitempty"`
Filter map[string]string `json:"filter,omitempty"`
}
EventPattern mirrors internal/trigger/event.EventPattern: a type glob plus an optional source and a dotted-path field filter.
func (EventPattern) Matches ¶
func (p EventPattern) Matches(evt *models.IngestedEvent) bool
Matches reports whether the ingested event satisfies the pattern.