Documentation
¶
Overview ¶
Package expert is the handle-based graph layer deliberately kept off the goav grammar: Graph(runtime) wires caller-provided pipeline Sources, Stages, and Sinks into a goav Task through explicit routes — for compositions the Stream grammar cannot express. Graph handles also anchor runtime Outputs: task.Attach(ctx, task.Route(node.Out().Route()).To(sink)). Most applications should start with input.Video() or input.Audio() and never need this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrRuntimeRequired = errors.New("expert: graph requires goav runtime")
ErrRuntimeRequired reports attempts to use expert graph wiring without a runtime created by goav.New, bundle.New, or bundle.MustNew.
Functions ¶
This section is empty.
Types ¶
type GraphBuilder ¶
type GraphBuilder interface {
// Source adds a source node under the given name (the source's own name
// when empty) and returns its handle.
Source(string, pipeline.Source) GraphNode
// Stage adds a stage node and returns its handle.
Stage(string, pipeline.Stage) GraphNode
// Sink adds a sink node and returns its handle.
Sink(string, pipeline.Sink) GraphNode
// Connect routes one outlet to the given inlets.
Connect(GraphOutlet, ...GraphInlet) GraphBuilder
// Describe reports the wired graph spec, or the first wiring error.
Describe() (pipeline.Spec, error)
// Build compiles the wired graph into a runnable goav live task.
Build(context.Context) (goav.Task, error)
}
GraphBuilder is the handle-based expert graph builder: named nodes wired by explicit Connect routes, described and built like any goav task.
func Graph ¶
func Graph(runtime *goav.Runtime) GraphBuilder
Graph opens the handle-based graph builder on a goav runtime.
type GraphInlet ¶
type GraphInlet struct {
// contains filtered or unexported fields
}
GraphInlet is the receiving end of a Connect route.
type GraphNode ¶
type GraphNode struct {
// contains filtered or unexported fields
}
GraphNode is an expert-graph handle to one added source, stage, or sink; its outlets and inlets wire Connect routes, and its Route anchors runtime Outputs through task.Route.
func (GraphNode) Event ¶
func (n GraphNode) Event(event av.EventType) GraphOutlet
Event returns an outlet routing only the given event type.
func (GraphNode) Out ¶
func (n GraphNode) Out() GraphOutlet
Out returns an outlet routing every message the node emits.
type GraphOutlet ¶
type GraphOutlet struct {
// contains filtered or unexported fields
}
GraphOutlet selects which messages leave a node on a route: everything (Out), one stream (Stream), or one event type (Event).
func (GraphOutlet) Name ¶
func (o GraphOutlet) Name() string
Name returns the name of the node the outlet routes from.
func (GraphOutlet) Route ¶
func (o GraphOutlet) Route() pipeline.Route
Route reports the route the outlet anchors for task.Route: the node plus the outlet's stream or event narrowing.