filter

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func (*Chain) MatchContext added in v1.3.5

func (c *Chain) MatchContext(ctx context.Context, e *msg.Envelope) (bool, error)

MatchContext also allows shutdown and disconnected inspection clients to interrupt evaluations already in progress.

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