router

package
v0.13.9 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouterOperator

type RouterOperator struct {
	helper.BasicOperator
	// contains filtered or unexported fields
}

RouterOperator is an operator that routes entries based on matching expressions

func (*RouterOperator) CanOutput

func (p *RouterOperator) CanOutput() bool

CanOutput will always return true for a router operator

func (*RouterOperator) CanProcess

func (p *RouterOperator) CanProcess() bool

CanProcess will always return true for a router operator

func (*RouterOperator) Outputs

func (p *RouterOperator) Outputs() []operator.Operator

Outputs will return all connected operators.

func (*RouterOperator) Process

func (p *RouterOperator) Process(ctx context.Context, entry *entry.Entry) error

Process will route incoming entries based on matching expressions

func (*RouterOperator) SetOutputs

func (p *RouterOperator) SetOutputs(operators []operator.Operator) error

SetOutputs will set the outputs of the router operator.

type RouterOperatorConfig

type RouterOperatorConfig struct {
	helper.BasicConfig `yaml:",inline"`
	Routes             []*RouterOperatorRouteConfig `json:"routes" yaml:"routes"`
	Default            helper.OutputIDs             `json:"default" yaml:"default"`
}

RouterOperatorConfig is the configuration of a router operator

func NewRouterOperatorConfig

func NewRouterOperatorConfig(operatorID string) *RouterOperatorConfig

NewRouterOperatorConfig config creates a new router operator config with default values

func (RouterOperatorConfig) Build

Build will build a router operator from the supplied configuration

type RouterOperatorRoute

type RouterOperatorRoute struct {
	helper.Labeler
	Expression      *vm.Program
	OutputIDs       helper.OutputIDs
	OutputOperators []operator.Operator
}

RouterOperatorRoute is a route on a router operator

type RouterOperatorRouteConfig

type RouterOperatorRouteConfig struct {
	helper.LabelerConfig `yaml:",inline"`
	Expression           string           `json:"expr"   yaml:"expr"`
	OutputIDs            helper.OutputIDs `json:"output" yaml:"output"`
}

RouterOperatorRouteConfig is the configuration of a route on a router operator

Jump to

Keyboard shortcuts

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