eventmatch

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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

func ResolveJSONPathBytes(data []byte, jsonPath string) (string, bool)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL