Help us shape the future of Go! Take the 2026 Go Developer Survey

conditional

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package conditional provides conditional branching node factory for registry integration.

Package conditional provides conditional branching node implementation for workflow graph execution.

Index

Constants

View Source
const (
	OutputPortTrue  = "true"
	OutputPortFalse = "false"
	OutputPortError = "error"
	InputPortMain   = "main"
)

Variables

This section is empty.

Functions

func NewConditionalNodeFactory

func NewConditionalNodeFactory() protocol.NodeFactory

NewConditionalNodeFactory creates a new factory instance.

Types

type ConditionalNode

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

ConditionalNode implements the Node interface for conditional branching This is a key control flow node that enables different execution paths.

func NewConditionalNode

func NewConditionalNode(id string, config map[string]any) (*ConditionalNode, error)

NewConditionalNode creates a new conditional branching node.

func (*ConditionalNode) Execute

Execute evaluates the condition and routes to true/false output ports.

func (*ConditionalNode) ID

func (n *ConditionalNode) ID() string

ID returns the node ID.

func (*ConditionalNode) InputPorts

func (n *ConditionalNode) InputPorts() []models.InputPort

InputPorts returns the input ports for the node.

func (*ConditionalNode) OutputPorts

func (n *ConditionalNode) OutputPorts() []models.OutputPort

OutputPorts returns the output ports for the node.

func (*ConditionalNode) Type

func (n *ConditionalNode) Type() string

Type returns the node type.

func (*ConditionalNode) Validate

func (n *ConditionalNode) Validate(config map[string]any) error

Validate validates the node configuration.

type ConditionalNodeFactory

type ConditionalNodeFactory struct{}

ConditionalNodeFactory creates ConditionalNode instances.

func (*ConditionalNodeFactory) Create

func (f *ConditionalNodeFactory) Create(ctx context.Context, id string, config map[string]any) (protocol.Node, error)

Create creates a new ConditionalNode instance.

func (*ConditionalNodeFactory) Description

func (f *ConditionalNodeFactory) Description() string

Description returns the factory description.

func (*ConditionalNodeFactory) ID

ID returns the factory ID.

func (*ConditionalNodeFactory) Name

func (f *ConditionalNodeFactory) Name() string

Name returns the factory name.

func (*ConditionalNodeFactory) Schema

func (f *ConditionalNodeFactory) Schema() map[string]any

Schema returns the JSON schema for Conditional node configuration.

Jump to

Keyboard shortcuts

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