common

package
v0.0.0-...-a264c11 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Registry 通用组件注册表 Registry is the common components registry

Functions

This section is empty.

Types

type EndNode

type EndNode struct {
	// Config 节点配置
	Config EndNodeConfiguration
	// contains filtered or unexported fields
}

EndNode 结束节点组件,用于触发规则链的结束回调。如果规则链设置了结束节点组件,则会替代默认的分支结束行为,只有运行到结束节点组件时,才会触发结束回调 EndNode is an end node component that triggers the end callback of the rule chain. If the rule chain has an end node component set, it will replace the default branch ending behavior.

功能说明: Function Description: 1. 接收消息并触发DoOnEnd回调 - Receives messages and triggers DoOnEnd callback 2. 使用上一个节点传入的关系类型 - Uses the relation type passed from the previous node 3. 不会继续传递消息到下一个节点 - Does not continue passing messages to next nodes

使用场景: Use Cases: - 规则链的明确结束点 - Explicit end point of rule chains - 触发特定的结束处理逻辑 - Trigger specific end processing logic - 替代默认的分支结束行为 - Replace default branch ending behavior

func (*EndNode) Destroy

func (x *EndNode) Destroy()

func (*EndNode) Init

func (x *EndNode) Init(ruleConfig types.Config, configuration types.Configuration) error

Init initializes the component.

func (*EndNode) New

func (x *EndNode) New() types.Node

New creates a new instance.

func (*EndNode) OnMsg

func (x *EndNode) OnMsg(ctx context.Context, msg types.RuleMsg) (next string, err error)

OnMsg processes the incoming message and triggers the end callback.

func (*EndNode) Type

func (x *EndNode) Type() types.NodeType

Type 返回组件类型 Type returns the component type identifier.

type EndNodeConfiguration

type EndNodeConfiguration struct {
	// ExprScript JavaScript脚本,用于确定消息路由路径
	// 函数参数:msg, metadata, msgType, dataType
	// 必须返回字符串数组,表示路由关系类型
	//
	// 内置变量:
	//   - $ctx: 上下文对象,提供缓存操作
	//   - global: 全局配置属性
	//   - vars: 规则链变量
	//   - UDF函数: 用户自定义函数
	//
	// 示例: "return ['route1', 'route2'];"
	Script string
}

ExprAssignNodeConfiguration ExprAssignNode配置结构

type StartNode

type StartNode struct {
}

StartNode 开始节点组件,用于触发规则链的结束回调。如果规则链设置了结束节点组件,则会替代默认的分支结束行为,只有运行到结束节点组件时,才会触发结束回调 StartNode is an end node component that triggers the end callback of the rule chain. If the rule chain has an end node component set, it will replace the default branch ending behavior.

功能说明: Function Description: 1. 接收消息并触发DoOnEnd回调 - Receives messages and triggers DoOnEnd callback 2. 使用上一个节点传入的关系类型 - Uses the relation type passed from the previous node 3. 不会继续传递消息到下一个节点 - Does not continue passing messages to next nodes

使用场景: Use Cases: - 规则链的明确结束点 - Explicit end point of rule chains - 触发特定的结束处理逻辑 - Trigger specific end processing logic - 替代默认的分支结束行为 - Replace default branch ending behavior

func (*StartNode) Destroy

func (x *StartNode) Destroy()

func (*StartNode) Init

func (x *StartNode) Init(ruleConfig types.Config, configuration types.Configuration) error

Init initializes the component.

func (*StartNode) New

func (x *StartNode) New() types.Node

New creates a new instance.

func (*StartNode) OnMsg

func (x *StartNode) OnMsg(ctx context.Context, msg types.RuleMsg) (string, error)

OnMsg processes the incoming message and triggers the end callback.

func (*StartNode) Type

func (x *StartNode) Type() types.NodeType

Type 返回组件类型 Type returns the component type identifier.

Jump to

Keyboard shortcuts

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