eventpattern

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package eventpattern implements EventBridge's event pattern language: a pattern is a JSON document whose leaves are arrays of conditions; an event matches when every pattern field matches (AND across fields), any condition in a leaf array matches (OR within a field), and arrays in the EVENT match if any element satisfies the condition.

Supported operators: exact values (strings, numbers, booleans, null), {"prefix": s}, {"suffix": s}, {"equals-ignore-case": s}, {"wildcard": s} (with * wildcards), {"anything-but": v|[v...]|{"prefix"/"suffix"/ "equals-ignore-case"/"wildcard": ...}}, {"numeric": [op, n, ...]}, {"exists": bool}, {"cidr": "a.b.c.d/n"}, and {"$or": [subpattern, ...]}.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pattern

type Pattern struct {
	// contains filtered or unexported fields
}

Pattern is a compiled event pattern.

func Parse

func Parse(src []byte) (*Pattern, error)

Parse compiles a pattern document.

func (*Pattern) Match

func (p *Pattern) Match(event []byte) (bool, error)

Match evaluates the pattern against an event document.

Jump to

Keyboard shortcuts

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