ext

package module
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: 11 Imported by: 0

README

flowlink-ext contains optional default extensions for FlowLink.

Current scope:

  • default node implementations
  • helper installation functions for components that expose a node.Registry

This module depends on flowlink-engine, while flowlink-engine does not depend on this module. That keeps the core runtime generic and lets business services or the control plane opt in to default nodes explicitly.

Node definition contract

Every executable node package owns one complete node.Definition:

  • Metadata.Type is the stable node.type stored in workflow JSON.
  • Metadata.DefaultConfig supplies a new node instance's initial values.
  • Metadata.ConfigSchema is the worker-owned editing and validation contract.
  • Executor decodes node.config into its internal Config and performs the work.

RegisterDefaultNodes only collects these definitions. A new backend node should follow this package-local contract instead of adding another hard-coded frontend form or rebuilding metadata in the ext root package. A package without an executor, such as the current grpcnode config decoder, is not registered until it has a real implementation.

Collector targets

trace.collect.mysql and trace.collect.clickhouse are always registered templates. Their connection fields belong to each workflow node instance, so different workspaces can export to different services. Registration options must not carry a tenant database sink.

The target table must already exist. MySQL uses the same column names as the control plane's flowlink_events table. ClickHouse accepts the JSONEachRow fields documented by internal/collectnode.Record; a typical table can use string columns for text/JSON values, nullable integer columns for node depth/index, nullable DateTime64(3) columns for timestamps, and MergeTree ORDER BY (workspace, trace_id, started_at).

Plaintext passwords are temporarily supported for debugging. Before production, node configs should store a workspace-authorized secret reference instead of the credential itself.

Documentation

Overview

Package ext 注册 FlowLink 默认扩展节点的可执行实现。

每个节点包通过 node.Definition 声明元信息、配置约束和执行器。

Index

Constants

This section is empty.

Variables

View Source
var ErrNodeRegistryProviderRequired = errors.New("node registry provider is required")

ErrNodeRegistryProviderRequired 表示安装默认节点时缺少节点注册中心提供者。

Functions

func Install

func Install(provider NodeRegistryProvider, opts *RegisterOptions) error

Install 将默认 node 安装到实现 NodeRegistryProvider 的节点注册中心提供者。

func RegisterDefaultNodes

func RegisterDefaultNodes(reg *node.Registry, opts *RegisterOptions)

RegisterDefaultNodes 注册默认可执行节点实现。

Types

type NodeRegistryProvider

type NodeRegistryProvider interface {
	NodeRegistry() *node.Registry
}

NodeRegistryProvider 是默认节点安装所需的最小能力。

这里不直接依赖 flowlink-plan,避免扩展包反向依赖运行编排入口。 plan.Assembly 和测试用的轻量 provider 只要暴露 NodeRegistry 即可安装默认节点。

type RegisterOptions

type RegisterOptions struct {
	HTTPClient *http.Client
}

RegisterOptions 配置默认节点注册时需要注入的外部依赖。

Directories

Path Synopsis
Package assertnode 提供用于断言上下文数据的默认 node 节点。
Package assertnode 提供用于断言上下文数据的默认 node 节点。
Package clickhousecollectnode 提供将一次运行 trace 导出到 ClickHouse 的 collector 节点注册逻辑。
Package clickhousecollectnode 提供将一次运行 trace 导出到 ClickHouse 的 collector 节点注册逻辑。
Package delaynode 提供让 workflow 在节点处等待指定时间的默认 node 节点。
Package delaynode 提供让 workflow 在节点处等待指定时间的默认 node 节点。
Package grpcnode 定义 gRPC 调用节点的配置解码结构。
Package grpcnode 定义 gRPC 调用节点的配置解码结构。
Package httpnode 提供发起 HTTP 请求的默认 node 节点。
Package httpnode 提供发起 HTTP 请求的默认 node 节点。
internal
collectnode
Package collectnode 放置 trace collector 节点之间共享的导出辅助逻辑。
Package collectnode 放置 trace collector 节点之间共享的导出辅助逻辑。
path
Package path 提供默认扩展节点读取上下文路径值的内部工具。
Package path 提供默认扩展节点读取上下文路径值的内部工具。
Package jsonnode 提供从上下文或 JSON 对象中提取字段的默认 node 节点。
Package jsonnode 提供从上下文或 JSON 对象中提取字段的默认 node 节点。
Package mysqlcollectnode 提供将一次运行 trace 导出到 MySQL 的 collector 节点注册逻辑。
Package mysqlcollectnode 提供将一次运行 trace 导出到 MySQL 的 collector 节点注册逻辑。
Package noopnode 提供不改变上下文的空操作 node 节点。
Package noopnode 提供不改变上下文的空操作 node 节点。
Package setnode 提供向 FlowContext 写入固定值或映射值的默认 node 节点。
Package setnode 提供向 FlowContext 写入固定值或映射值的默认 node 节点。

Jump to

Keyboard shortcuts

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