filter

package
v1.21.81 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package filter applies CEL expressions to api table rows and tree nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapRows added in v1.21.81

func MapRows(rows []map[string]any, expression string) ([]map[string]any, error)

func TableRows

func TableRows(rows []api.PrettyDataRow, filterExpr string) ([]api.PrettyDataRow, error)

TableRows filters table rows using a CEL expression. Field values are injected directly into the CEL context (no "row." prefix). Returns filtered rows or error if CEL expression is invalid.

func TreeNode

func TreeNode(node api.TreeNode, filterExpr string) (api.TreeNode, error)

TreeNode recursively filters tree nodes using a CEL expression. Field values from node content are injected directly into the CEL context. Returns filtered tree or error if CEL expression is invalid.

Types

type MapPredicate added in v1.21.81

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

func CompileMapPredicate added in v1.21.81

func CompileMapPredicate(keys []string, expression string) (*MapPredicate, error)

func (*MapPredicate) Match added in v1.21.81

func (predicate *MapPredicate) Match(row map[string]any) (bool, error)

Jump to

Keyboard shortcuts

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