Documentation
¶
Index ¶
- func EvaluateRule(rule string, data map[string]interface{}) (bool, string, error)
- type RuleExecutionResult
- type TrimmedRule
- func (tr *TrimmedRule) Condition(rule string, data map[string]interface{}) TrimmedRuleExecutionResult
- func (tr *TrimmedRule) Or(rule string, data map[string]interface{}) TrimmedRuleExecutionResult
- func (tr *TrimmedRule) Set(rule string, data map[string]interface{}) TrimmedRuleExecutionResult
- func (tr *TrimmedRule) String() string
- type TrimmedRuleExecutionResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RuleExecutionResult ¶
type RuleExecutionResult struct {
Rule string
Passed bool
Details string // Ex: "$.idade (20) >= 18 (true)" ou mensagem de erro
}
RuleExecutionResult armazena o resultado da execução de uma única regra.
type TrimmedRule ¶
type TrimmedRule string
func NewTrimmedRule ¶
func NewTrimmedRule(rule string) *TrimmedRule
func (*TrimmedRule) Condition ¶
func (tr *TrimmedRule) Condition(rule string, data map[string]interface{}) TrimmedRuleExecutionResult
func (*TrimmedRule) Or ¶
func (tr *TrimmedRule) Or(rule string, data map[string]interface{}) TrimmedRuleExecutionResult
func (*TrimmedRule) Set ¶
func (tr *TrimmedRule) Set(rule string, data map[string]interface{}) TrimmedRuleExecutionResult
func (*TrimmedRule) String ¶
func (tr *TrimmedRule) String() string
Click to show internal directories.
Click to hide internal directories.