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
}
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.