condition

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package condition contains the condition node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConditionConfig

type ConditionConfig struct {
	// Property is a dotted path into the payload (same as switch rules)
	Property string `json:"property"`
	// Op is the comparison operator: eq | neq | gt | lt | contains | empty
	Op string `json:"op"`
	// Value is the comparison operand
	Value string `json:"value"`
}

ConditionConfig holds configuration for the condition node — a thin two-output (true/false) variant of the switch node kept for backward compatibility with existing flows.

type ConditionNode

type ConditionNode struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

ConditionNode routes the message to output_1 when the configured expression is true and output_2 when it is false — a single-rule switch with a dedicated false port.

func NewConditionNode

func NewConditionNode(node nodestore.NodeInterface, config *ConditionConfig) *ConditionNode

NewConditionNode creates a new condition node

func (*ConditionNode) Execute

Execute passes the input through unchanged — routing is done by the host via SelectPorts

func (*ConditionNode) SelectPorts

func (n *ConditionNode) SelectPorts(input, output nodestore.MessageInterface) []string

SelectPorts evaluates the configured expression against the input payload: true → ["output_1"], false → ["output_2"]. Unlike the switch node a condition always routes — there is no "no match" case.

Jump to

Keyboard shortcuts

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