rules

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuleManager

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

RuleManager gerencia a compilação e avaliação de expressões CEL.

func NewRuleManager

func NewRuleManager() (*RuleManager, error)

NewRuleManager inicializa o ambiente CEL com as variáveis padrão esperadas.

func (*RuleManager) CompileProgram

func (rm *RuleManager) CompileProgram(expr string) (cel.Program, error)

CompileProgram expõe a compilação do CEL.

func (*RuleManager) EvaluateBool

func (rm *RuleManager) EvaluateBool(expression string, ctx map[string]interface{}) (bool, error)

EvaluateBool processa regras de validação (deve retornar true/false).

func (*RuleManager) EvaluateValue

func (rm *RuleManager) EvaluateValue(expression string, ctx map[string]interface{}) (interface{}, error)

EvaluateValue processa regras de transformação (retorna um valor dinâmico).

func (*RuleManager) ExecuteTransformation

func (rm *RuleManager) ExecuteTransformation(rule config.TransformationRule, ctx map[string]interface{}) (*TransformationResult, error)

ExecuteTransformation processa uma regra de transformação completa. Verifica a condição e, se atendida, calcula o valor. Se não, verifica o ElseValue.

type TransformationResult

type TransformationResult struct {
	Applied bool
	Target  string
	Value   interface{}
}

TransformationResult contém o resultado de uma operação de transformação.

Jump to

Keyboard shortcuts

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