cel

package
v0.3.31 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCompositeCostEstimator

func NewCompositeCostEstimator(estimators ...checker.CostEstimator) checker.CostEstimator

Types

type CEL

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

func NewCEL

func NewCEL(objectCache objectcache.ObjectCache, cfg config.Config) (*CEL, error)

func (*CEL) EvaluateExpression

func (c *CEL) EvaluateExpression(event *events.EnrichedEvent, expression string) (string, error)

func (*CEL) EvaluateRule

func (c *CEL) EvaluateRule(event *events.EnrichedEvent, expressions []typesv1.RuleExpression) (bool, error)

func (*CEL) RegisterCustomType

func (c *CEL) RegisterCustomType(eventType utils.EventType, obj interface{}) error

func (*CEL) RegisterEventConverter added in v0.3.31

func (c *CEL) RegisterEventConverter(eventType utils.EventType, converter func(utils.K8sEvent) utils.K8sEvent)

func (*CEL) RegisterHelper

func (c *CEL) RegisterHelper(function cel.EnvOption) error

type CompositeCostEstimator

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

CompositeCostEstimator holds multiple estimators and queries them in order.

func (*CompositeCostEstimator) EstimateCallCost

func (c *CompositeCostEstimator) EstimateCallCost(function, overloadID string, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate

EstimateCallCost iterates through its estimators and returns the first non-nil estimate.

func (*CompositeCostEstimator) EstimateSize

func (c *CompositeCostEstimator) EstimateSize(element checker.AstNode) *checker.SizeEstimate

EstimateSize iterates through its estimators for a size estimate.

type RuleEvaluator added in v0.3.31

type RuleEvaluator interface {
	EvaluateRule(event *events.EnrichedEvent, expressions []typesv1.RuleExpression) (bool, error)
	EvaluateExpression(event *events.EnrichedEvent, expression string) (string, error)
	RegisterHelper(function cel.EnvOption) error
	RegisterCustomType(eventType utils.EventType, obj interface{}) error
	RegisterEventConverter(eventType utils.EventType, converter func(utils.K8sEvent) utils.K8sEvent)
}

Directories

Path Synopsis
k8s
net

Jump to

Keyboard shortcuts

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