cel

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultEnv

func DefaultEnv() (*cel.Env, error)

DefaultEnv produces a cel.Env with the necessary cel.EnvOption and cel.ProgramOption values preconfigured for usage throughout the module.

func NewExecutor added in v2.8.0

func NewExecutor() serde.RuleExecutor

NewExecutor creates a new CEL rule executor

func NewFieldExecutor added in v2.8.0

func NewFieldExecutor() serde.RuleExecutor

NewFieldExecutor creates a new CEL field rule executor

func Register

func Register()

Register registers the CEL rule executor

Types

type Executor

type Executor struct {
	Config map[string]string
	// contains filtered or unexported fields
}

Executor is a CEL rule executor

func (*Executor) Close

func (c *Executor) Close() error

Close closes the executor

func (*Executor) Configure

func (c *Executor) Configure(clientConfig *schemaregistry.Config, config map[string]string) error

Configure configures the executor

func (*Executor) Transform

func (c *Executor) Transform(ctx serde.RuleContext, msg interface{}) (interface{}, error)

Transform transforms the message using the rule

func (*Executor) Type

func (c *Executor) Type() string

Type returns the type of the executor

type FieldExecutor

type FieldExecutor struct {
	serde.AbstractFieldRuleExecutor
	// contains filtered or unexported fields
}

FieldExecutor is a CEL field rule executor

func (*FieldExecutor) Close

func (f *FieldExecutor) Close() error

Close closes the executor

func (*FieldExecutor) Configure

func (f *FieldExecutor) Configure(clientConfig *schemaregistry.Config, config map[string]string) error

Configure configures the executor

func (*FieldExecutor) NewTransform

func (f *FieldExecutor) NewTransform(ctx serde.RuleContext) (serde.FieldTransform, error)

NewTransform creates a new transform

func (*FieldExecutor) Type

func (f *FieldExecutor) Type() string

Type returns the type of the executor

type FieldExecutorTransform

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

FieldExecutorTransform is a CEL field rule executor transform

func (*FieldExecutorTransform) Transform

func (f *FieldExecutorTransform) Transform(ctx serde.RuleContext, fieldCtx serde.FieldContext, fieldValue interface{}) (interface{}, error)

Transform transforms the field value using the rule