pass

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

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

func (segment Pass) New(config map[string]string) segments.Segment

Every Segment must implement a New method, even if there isn't any config it is interested in.

func (*Pass) Run

func (segment *Pass) Run(wg *sync.WaitGroup)

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 segment.ShutdownParentPipeline() 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.

Jump to

Keyboard shortcuts

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