pipeline

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 8 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 New

func New() *Pipeline

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

func (p *Pipeline) ErrorChan() <-chan error

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

func (p *Pipeline) Failure() error

Failure returns the first terminal plugin error until the next run starts.

func (*Pipeline) IsRunning added in v0.37.0

func (p *Pipeline) IsRunning() bool

IsRunning returns true if the pipeline is currently running

func (*Pipeline) RegisterObserver added in v0.38.0

func (p *Pipeline) RegisterObserver(ch chan<- event.Event)

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) Start

func (p *Pipeline) Start() error

Start starts the pipeline with a background context. See StartContext.

func (*Pipeline) StartContext added in v0.46.0

func (p *Pipeline) StartContext(parent context.Context) error

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

func (p *Pipeline) Stop() error

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.

Jump to

Keyboard shortcuts

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