Documentation ¶
Overview ¶
Serves as a template for new segments and forwards flows, otherwise does nothing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pass ¶
type Pass struct {
segments.BaseSegment // always embed this, no need to repeat I/O chan code
}
The Pass Segment is considered a template for any additional Segments, as it showcases the exact implementation.
func (Pass) New ¶
Every Segment must implement a New method, even if there isn't any config it is interested in.
func (*Pass) Run ¶
The main goroutine of any Segment. Any Run method must: 1. close(segment.Out) when the In channel is closed by the previous segment or the Pipeline itself 2. call wg.Done() before exiting 3. if exiting for any other reason, use os.Exit or just continue to pass from In to Out
Usually, when using a range over In in combination with below defer, nothing will go wrong. However, some segments have a legitimate use case for using `for {}`, in which case care must be taken to keep draining In.