Documentation
¶
Index ¶
- func ParseReferencedNodes(expression string) ([]string, error)
- func ValidateBareExpression(raw string, knownNodeNames map[string]struct{}) error
- func ValidateCanvasExpressions(reg *registry.Registry, nodes []*componentpb.Node) map[string][]ExpressionError
- func ValidateExpression(raw string, knownNodeNames map[string]struct{}) error
- type ExpressionError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseReferencedNodes ¶
ParseReferencedNodes returns the names referenced via $['Name'] inside the given expression body, in source order.
func ValidateBareExpression ¶
ValidateBareExpression checks the same expression body but skips the strict compile-time identifier resolution. Use it for FieldTypeExpression values without {{ }} framing: at runtime those flow through as literal strings unless a component explicitly evaluates them, so identifiers like "default" or "ok" are valid literal payloads, while obvious syntax errors and unknown node references still need to be caught.
func ValidateCanvasExpressions ¶
func ValidateCanvasExpressions(reg *registry.Registry, nodes []*componentpb.Node) map[string][]ExpressionError
ValidateCanvasExpressions runs static expression validation across every node's configuration. Errors are returned per node ID; an empty result means nothing failed.
func ValidateExpression ¶
ValidateExpression checks a {{ ... }} placeholder body for syntax errors, unknown node references, function arity mistakes, and unresolved identifiers. Returns nil for a valid expression.
Types ¶
type ExpressionError ¶
type ExpressionError struct {
NodeID string
NodeName string
FieldPath string
Expression string
Err error
}
ExpressionError describes a single static validation failure for one expression inside a node's configuration.
func (*ExpressionError) Error ¶
func (e *ExpressionError) Error() string