filter

package
v1.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package filter compiles and evaluates CEL expressions against message envelopes. Numeric header fields are exposed as CEL ints so plain integer literals work (msg.pgn == 127250).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

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

func Compile

func Compile(exprs []string) (*Chain, error)

func (*Chain) Match

func (c *Chain) Match(e *msg.Envelope) (bool, error)

Match evaluates all expressions (AND). Returns an error if any expression errors at eval time; callers drop the message and count it.

type Diagnostic

type Diagnostic struct {
	Expression int
	Line       int
	Column     int
	EndColumn  int
	Message    string
}

Diagnostic is one CEL compile error tied to a byte range in one expression. Line is 1-based; Column and EndColumn are 0-based byte columns. CEL reports an error point rather than a span, so Diagnose expands that point to the smallest surrounding token that can usefully be highlighted by an editor.

func Diagnose

func Diagnose(exprs []string) ([]Diagnostic, error)

Diagnose compiles every expression and returns every parse/type-check error instead of stopping at the first invalid filter. An error is reserved for an environment construction failure; invalid CEL is represented by diagnostics.

Jump to

Keyboard shortcuts

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