Documentation
¶
Index ¶
- func NewCompositeCostEstimator(estimators ...checker.CostEstimator) checker.CostEstimator
- type CEL
- func (c *CEL) EvaluateExpression(event *events.EnrichedEvent, expression string) (string, error)
- func (c *CEL) EvaluateExpressionByMap(event map[string]any, expression string, eventType utils.EventType) (string, error)
- func (c *CEL) EvaluateRule(event *events.EnrichedEvent, expressions []typesv1.RuleExpression) (bool, error)
- func (c *CEL) EvaluateRuleByMap(event map[string]any, eventType utils.EventType, ...) (bool, error)
- func (c *CEL) RegisterCustomType(eventType utils.EventType, obj interface{}) error
- func (c *CEL) RegisterHelper(function cel.EnvOption) error
- type CELRuleEvaluator
- type CelEventSerializer
- type CelSerializer
- type CompositeCostEstimator
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 (*CEL) EvaluateExpressionByMap ¶
func (*CEL) EvaluateRule ¶
func (c *CEL) EvaluateRule(event *events.EnrichedEvent, expressions []typesv1.RuleExpression) (bool, error)
func (*CEL) EvaluateRuleByMap ¶
func (*CEL) RegisterCustomType ¶
type CELRuleEvaluator ¶
type CELRuleEvaluator interface {
EvaluateRule(event *events.EnrichedEvent, expressions []typesv1.RuleExpression) (bool, error)
EvaluateExpressionByMap(event map[string]any, expression string, eventType utils.EventType) (string, error)
EvaluateRuleByMap(event map[string]any, eventType utils.EventType, 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
}
type CelEventSerializer ¶
type CelEventSerializer struct{}
CelEventSerializer is a default implementation of CelSerializer.
type CelSerializer ¶
CelSerializer is an interface that serializes events for CEL evaluation.
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.
Click to show internal directories.
Click to hide internal directories.