跳转到主要内容

这是本节的多页打印视图。 .

返回本页常规视图.

快速上手

安装 Eventboat,写第一条管道,验证并运行。

1 - 安装

在你的平台上安装 Eventboat CLI。

前提

  • Go 1.25+(从源码构建)
  • 零运行时依赖——全部编译进一个二进制

安装

go install github.com/eventboat/eventboat/cmd/eventboat@latest

验证:

eventboat help

应看到帮助界面,列出 11 个命令。

下一步

2 - 第一条管道

写一个三段式 YAML 管道,验证、测试并运行。

三段式格式

每个 Eventboat 管道是一个 YAML 文件,三个顶层段:sourcestransformssinks——通过 from 连边。

apiVersion: eventboat/v3
kind: Pipeline
metadata: { name: my-first-pipeline }

sources:
  ingest:
    cron: { expression: "*/5 * * * *" }   # 每 5 分钟

transforms:
  hello:
    from: [ingest]
    script: |
      payload.greeting = "hello from eventboat"
      payload.timestamp = meta.ingest_time

sinks:
  console:
    from: [hello]
    drop: {}                              # 丢弃(演示用)

验证(关卡 1)

eventboat verify --config pipeline.yaml

输出:pipeline.yaml: 0 error(s), 0 warning(s)

运行

eventboat run --config pipeline.yaml

管道启动;每 5 分钟 cron 源触发,Starlark 脚本丰富消息,sink 接收。

加分支(CEL 谓词)

sinks:
  important:
    from: { hello: { when: 'payload.score > 100' } }
    http: { url: "https://api.example.com/alerts" }

  archive:
    from: [hello]                          # 无条件边
    drop: {}

Agent 模式

# 启动 MCP 服务器 — AI Agent 经 stdio 连接
eventboat mcp --stdio

# 或带管理界面
eventboat mcp --http