eventpattern

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package eventpattern holds the numeric-comparison and CIDR-matching core shared by EventBridge's and Pipes' event-pattern content filters (eb-event-patterns-content-based-filtering.html). Pipes' Filter.Pattern is specified as an EventBridge pattern with no grammar of its own, so the two services' matchers are meant to stay aligned; this package holds just the pieces that were already identical, so they no longer drift out of sync by hand. The two services' broader matcher-dispatch trees (operator support, unrecognized-key handling, validation) diverge enough that they are not unified here -- see bd gopherstack-amfu.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareNumeric

func CompareNumeric(op string, num, val float64) bool

CompareNumeric reports whether "num op val" holds for one of EventBridge's numeric matcher operators (eb-filtering-numeric-matching): >, >=, <, <=, =. An unrecognized op reports false.

func MatchCIDR

func MatchCIDR(cidrStr, ipStr string) bool

MatchCIDR reports whether ipStr is an IP address inside the cidrStr range (eb-filtering-ip-address). Either being malformed reports false.

func MatchNumericRules

func MatchNumericRules(num float64, rules []any) bool

MatchNumericRules applies EventBridge's numeric matcher rules to num. Rules come in (operator, value) pairs -- e.g. [">", 5, "<", 10] -- that must ALL hold; a malformed pair (wrong types) fails the match.

func ToFloat64

func ToFloat64(v any) (float64, bool)

ToFloat64 converts a decoded JSON numeric value to float64.

Types

This section is empty.

Jump to

Keyboard shortcuts

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