router

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 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) GetOutputIDs

func (p *RouterOperator) GetOutputIDs() []string

GetOutputIDs will return all connected operators.

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

func (p *RouterOperator) SetOutputIDs(opIDs []string)

SetOutputIDs will do nothing.

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 `mapstructure:",squash" yaml:",inline"`
	Routes             []*RouterOperatorRouteConfig `mapstructure:"routes" json:"routes" yaml:"routes"`
	Default            helper.OutputIDs             `mapstructure:"default" 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.Attributer
	Expression      *vm.Program
	OutputIDs       helper.OutputIDs
	OutputOperators []operator.Operator
}

RouterOperatorRoute is a route on a router operator

type RouterOperatorRouteConfig

type RouterOperatorRouteConfig struct {
	helper.AttributerConfig `mapstructure:",squash" yaml:",inline"`
	Expression              string           `mapstructure:"expr" json:"expr"   yaml:"expr"`
	OutputIDs               helper.OutputIDs `mapstructure:"output" 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