Documentation
¶
Index ¶
- type Pipeline
- func (p *Pipeline) AddFilter(filter plugin.ManagedPlugin)
- func (p *Pipeline) AddInput(input plugin.ManagedPlugin)
- func (p *Pipeline) AddOutput(output plugin.ManagedPlugin)
- func (p *Pipeline) ErrorChan() <-chan error
- func (p *Pipeline) Failed() <-chan struct{}
- func (p *Pipeline) Failure() error
- func (p *Pipeline) IsRunning() bool
- func (p *Pipeline) RegisterObserver(ch chan<- event.Event)
- func (p *Pipeline) Start() error
- func (p *Pipeline) StartContext(parent context.Context) error
- func (p *Pipeline) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline owns the lifecycle and connections of its configured plugins. Configure it before Start. Do not modify its topology during a run, share plugin instances between pipelines, or restart connected plugins individually.
func (*Pipeline) AddFilter ¶
func (p *Pipeline) AddFilter(filter plugin.ManagedPlugin)
AddFilter appends a transform in event-processing order. Call before Start.
func (*Pipeline) AddInput ¶
func (p *Pipeline) AddInput(input plugin.ManagedPlugin)
AddInput appends a source. Configure the topology before Start.
func (*Pipeline) AddOutput ¶
func (p *Pipeline) AddOutput(output plugin.ManagedPlugin)
AddOutput appends a sink in blocking broadcast order. Call before Start.
func (*Pipeline) ErrorChan ¶
ErrorChan returns the pipeline's error channel (read-only). Note: After calling Stop() and Start() to restart the pipeline, consumers must call ErrorChan() again to get the new channel. References obtained before restart will point to a closed channel.
func (*Pipeline) Failed ¶ added in v0.46.0
func (p *Pipeline) Failed() <-chan struct{}
Failed closes when a plugin reports terminal failure. Forwarding is canceled and IsRunning becomes false. The owner must call Stop to release resources. Normal Stop does not close it; reacquire it after restarting the pipeline.
func (*Pipeline) Failure ¶ added in v0.46.0
Failure returns the first terminal plugin error until the next run starts.
func (*Pipeline) IsRunning ¶ added in v0.37.0
IsRunning returns true if the pipeline is currently running
func (*Pipeline) RegisterObserver ¶ added in v0.38.0
RegisterObserver sets an observer channel that receives a copy of every event passing through the pipeline. Sends are non-blocking: if the channel is full, events are dropped. Only one observer is supported. Call before Start().
func (*Pipeline) StartContext ¶ added in v0.46.0
StartContext initiates the configured plugins with a context governing setup and plugin work. Cancellation during setup rolls back acquired plugins. After successful startup, the caller must call Stop even if ctx is canceled. A stopped pipeline can be restarted by calling Start() again. Note: After restart, consumers must re-obtain channels via ErrorChan() as the old channels are closed. Stop interrupts setup through the context supplied to every plugin. A failed plugin must clean up its partial startup before returning. Outputs start first, followed by filters in reverse order, then inputs. Declared roles are validated before startup and ports before wiring. Outputs and observers are optional. Without them, events are drained and discarded so production can continue without consumers.
func (*Pipeline) Stop ¶
Stop shuts down the pipeline and the plugins it successfully started. Stop is idempotent and safe to call multiple times A stopped pipeline can be restarted by calling Start() again Stop cancels startup before waiting for the lifecycle lock. Setup must return before Stop can finish. Forwarding exits before plugins stop, so shutdown does not guarantee delivery of all buffered events.