stream

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package stream renders a stream.TopologySpec as a human-readable YAML stream topology document. The output describes the pipeline's sources, operators, and sinks — analogous to render/pipeline for forge.PipelineSpec.

Usage:

topo := stream.NewTopology("Sensor OEE Pipeline", "1.0.0").
    WithSource("mqtt/sensors/+", "Raw sensor readings").
    WithFilter("oee < 0.65").
    WithSink("mqtt/alerts/oee", "Low-OEE alerts")
stream.WithApply(topo, oeeCalcFn) // captures forge function hash for auditability

yamlBytes, err := streamrender.Render(topo.Spec())

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(spec gstream.TopologySpec) ([]byte, error)

Render serialises spec as a streamTopology YAML document. The output is deterministic for a given spec (steps appear in registration order).

Example
package main

import (
	streamrender "github.com/DaniDeer/go-codex/render/stream"
	gstream "github.com/DaniDeer/go-codex/stream"
)

func main() {
	topo := gstream.NewTopology("Sensor OEE Pipeline", "1.0.0").
		WithDescription("Real-time OEE from MQTT sensor readings.").
		WithSource("mqtt/sensors/+/data", "Raw sensor readings").
		WithFilter("value > 0").
		WithWindow("1-minute tumbling window").
		WithSink("mqtt/alerts/oee", "OEE alert publisher")

	yaml, err := streamrender.Render(topo.Spec())
	if err != nil {
		panic(err)
	}
	_ = yaml // yaml contains the stream topology as a YAML document
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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