flow

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Separator is the character used separate flow parts.
	Separator = "|"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Flow

type Flow struct {
	Input   *Input
	Outputs Outputs
}

Flow connects a input and one or more outputs.

func (*Flow) Run

func (f *Flow) Run(ctx core.Context, m core.Middleware)

Run runs the flow.

type Input

type Input struct {
	Source    core.Source
	Modifiers core.InputModifiers
	Format    core.InputFormat
	// contains filtered or unexported fields
}

Input joins a source and a format with optional modifiers.

func NewInput

func NewInput(s core.Source, mods core.InputModifiers, f core.InputFormat) *Input

NewInput creates a new input.

func (*Input) Done

func (i *Input) Done() <-chan struct{}

Done returns a channel indicating that this input is done.

func (*Input) Init

func (i *Input) Init(ctx core.Context, m core.Middleware)

Init starts the input.

type Output

type Output struct {
	Format    core.OutputFormat
	Modifiers core.OutputModifiers
	Sink      core.Sink
	// contains filtered or unexported fields
}

Output joins a format and sink with optional modifiers.

func NewOutput

func NewOutput(f core.OutputFormat, mods core.OutputModifiers, s core.Sink) *Output

NewOutput creates an output connecting a format and a sink.

func (*Output) Done

func (o *Output) Done() <-chan struct{}

Done returns a channel that signals when the output has completed.

func (*Output) Init

func (o *Output) Init(ctx core.Context)

Init starts the output.

func (*Output) Write

func (o *Output) Write(n interface{})

Write writes to the output.

type Outputs

type Outputs []*Output

Outputs is a slice of output.

func (Outputs) Drain

func (oo Outputs) Drain(ctx core.Context)

Drain drains all outputs.

func (Outputs) Init

func (oo Outputs) Init(ctx core.Context)

Init initializes the outputs.

func (Outputs) Write

func (oo Outputs) Write(n interface{})

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser parses text into a *flow.Flow

func NewParser

func NewParser() *Parser

NewParser creates a new parser.

func (*Parser) LoadInputFormat

func (p *Parser) LoadInputFormat(name string, ctor core.InputFormatCtor) bool

LoadInputFormat loads a new input format and returns a value indicating whether the value replaced a previous entry.

func (*Parser) LoadInputModifier

func (p *Parser) LoadInputModifier(name string, ctor core.InputModifierCtor) bool

LoadInputModifier loads a new input modifier and returns a value inidicating whether the value replaced a previous entry.

func (*Parser) LoadOutputFormat

func (p *Parser) LoadOutputFormat(name string, ctor core.OutputFormatCtor) bool

LoadOutputFormat loads a new output format and returns a value indicating whether the value replaced a previous entry.

func (*Parser) LoadOutputModifier

func (p *Parser) LoadOutputModifier(name string, ctor core.OutputModifierCtor) bool

LoadOutputModifier loads a new output modifier and returns a value indicating whether the value replaced a previous entry.

func (*Parser) LoadSink

func (p *Parser) LoadSink(name string, ctor core.SinkCtor) bool

LoadSink loads a new sink and returns a value indicatin whether the value replaced a previous entry.

func (*Parser) LoadSource

func (p *Parser) LoadSource(name string, ctor core.SourceCtor) bool

LoadSource loads a new source and returns a value indicating whether the value replaced a previous entry.

func (*Parser) Parse

func (p *Parser) Parse(ctx core.Context, inputLine string, outputLines []string) (*Flow, error)

Parse parses text into a flow.

Jump to

Keyboard shortcuts

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