setnode

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package setnode 提供向 FlowContext 写入固定值或映射值的默认 node 节点。

Index

Constants

View Source
const NodeType = "set"

Variables

View Source
var ErrKeyRequired = errors.New("set node key is required")

ErrKeyRequired 表示 Set 节点缺少要写入的 key。

Functions

func Definition

func Definition() node.Definition

Definition 返回赋值节点的完整注册定义。

Types

type Config

type Config struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
}

Config 是 set node 从 node.config 解码得到的内部配置。

func DefaultConfig

func DefaultConfig() *Config

type Node

type Node struct{}

Node 同时写 FlowContext 并返回输出,保证后续节点和调试结果都能看到该值。

func NewNode

func NewNode() *Node

func (*Node) Execute

func (e *Node) Execute(fc *core.FlowContext, node *core.NodeDefine) (interface{}, error)

Jump to

Keyboard shortcuts

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