Documentation
¶
Index ¶
- Variables
- func Link[T any, A node.OutputNode[T], B node.InputNode[T]](nodeA A, portA string, nodeB B, portB string) error
- func LinkAny(nodeA node.Node, portA string, nodeB node.Node, portB string) error
- func LinkWithBufferSize[T any, A node.OutputNode[T], B node.InputNode[T]](nodeA A, portA string, nodeB B, portB string, bufferSize int) error
- type BuildOption
- type Builder
- type ChanEdge
- type Description
- type EdgeDef
- type EdgeDescription
- type EdgeSnapshot
- type Geometry
- func (g *Geometry) AddEdge(fromNode, fromPort, toNode, toPort string) error
- func (g *Geometry) AddEdgeDef(definition EdgeDef) error
- func (g *Geometry) AddNode(id string, n node.Node) error
- func (g *Geometry) AddNodeDef(definition NodeDef) error
- func (g *Geometry) AddResourceCloser(closer func() error) error
- func (g *Geometry) Close() error
- func (g *Geometry) Description() Description
- func (g *Geometry) Edges() []EdgeDef
- func (g *Geometry) Nodes() []NodeDef
- func (g *Geometry) SetNodeDescription(id string, description NodeDescription) error
- type NodeDef
- type NodeDescription
- type NodeSnapshot
- type ObservationMode
- type Pipeline
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidPipeline = errors.New("invalid pipeline")
Functions ¶
func LinkWithBufferSize ¶
func LinkWithBufferSize[T any, A node.OutputNode[T], B node.InputNode[T]](nodeA A, portA string, nodeB B, portB string, bufferSize int) error
LinkWithBufferSize connects two nodes using a channel edge with the requested capacity. A small capacity is useful for pipelines that must apply strict backpressure to large packets or frames.
Types ¶
type BuildOption ¶
type BuildOption func(*buildConfig)
func WithObservation ¶
func WithObservation(mode ObservationMode) BuildOption
type ChanEdge ¶
type ChanEdge[T any] struct { // contains filtered or unexported fields }
func NewChanEdge ¶
type Description ¶
type Description struct {
Nodes []NodeDescription
Edges []EdgeDescription
}
func (Description) Clone ¶
func (d Description) Clone() Description
Clone returns an independent copy that shares no state with d.
type EdgeDef ¶
type EdgeDef = EdgeDescription
type EdgeDescription ¶
type EdgeSnapshot ¶
type Geometry ¶
type Geometry struct {
// contains filtered or unexported fields
}
Geometry owns all added nodes until Builder.Build transfers them to a Pipeline. Close releases nodes when a negotiated geometry is abandoned.
func NewGeometry ¶
func NewGeometry() *Geometry
func (*Geometry) AddEdgeDef ¶
func (*Geometry) AddNodeDef ¶
func (*Geometry) AddResourceCloser ¶
AddResourceCloser registers a shared resource (such as a worker pool held by several nodes) to be closed once every node in the eventual Pipeline has closed, or immediately if the geometry is abandoned instead of built.
func (*Geometry) Description ¶
func (g *Geometry) Description() Description
func (*Geometry) SetNodeDescription ¶
func (g *Geometry) SetNodeDescription(id string, description NodeDescription) error
type NodeDescription ¶
type NodeDescription struct {
ID string
Role manifest.NodeType
Plugin string
// Configuration is excluded from JSON: plugin config types are free to
// hold non-marshalable values (e.g. codec-flac's Apodizations, which are
// func([]float64)), so this live object was never meant as a wire
// format. Use cliflag.DescribeStruct for a safe, field-by-field view.
Configuration registry.Configuration `json:"-"`
Resources registry.ResourceGrant
Inputs []media.StreamInfo
Outputs []media.StreamInfo
AutoInserted bool
}
type NodeSnapshot ¶
type ObservationMode ¶
type ObservationMode uint8
const ( ObservationOff ObservationMode = iota ObservationProgress ObservationMetrics )
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline owns its nodes for their complete lifecycle. A Pipeline is single-use: Run may be called exactly once, and always closes every node before returning.
func (*Pipeline) Description ¶
func (p *Pipeline) Description() Description