router

package
v0.111.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 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 Config added in v0.53.0

type Config struct {
	helper.BasicConfig `mapstructure:",squash"`
	Routes             []*RouteConfig `mapstructure:"routes"`
	Default            []string       `mapstructure:"default"`
}

Config is the configuration of a router operator

func NewConfig added in v0.53.0

func NewConfig() *Config

NewConfig config creates a new router operator config with default values

func NewConfigWithID added in v0.59.0

func NewConfigWithID(operatorID string) *Config

NewConfigWithID config creates a new router operator config with default values

func (Config) Build added in v0.53.0

Build will build a router operator from the supplied configuration

type Route added in v0.53.0

type Route struct {
	helper.Attributer
	Expression      *vm.Program
	OutputIDs       []string
	OutputOperators []operator.Operator
}

Route is a route on a router operator

type RouteConfig added in v0.53.0

type RouteConfig struct {
	helper.AttributerConfig `mapstructure:",squash"`
	Expression              string   `mapstructure:"expr"`
	OutputIDs               []string `mapstructure:"output"`
}

RouteConfig is the configuration of a route on a router operator

type Transformer added in v0.53.0

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

Transformer is an operator that routes entries based on matching expressions

func (*Transformer) CanOutput added in v0.53.0

func (t *Transformer) CanOutput() bool

CanOutput will always return true for a router operator

func (*Transformer) CanProcess added in v0.53.0

func (t *Transformer) CanProcess() bool

CanProcess will always return true for a router operator

func (*Transformer) GetOutputIDs added in v0.53.0

func (t *Transformer) GetOutputIDs() []string

GetOutputIDs will return all connected operators.

func (*Transformer) Outputs added in v0.53.0

func (t *Transformer) Outputs() []operator.Operator

Outputs will return all connected operators.

func (*Transformer) Process added in v0.53.0

func (t *Transformer) Process(ctx context.Context, entry *entry.Entry) error

Process will route incoming entries based on matching expressions

func (*Transformer) SetOutputIDs added in v0.53.0

func (t *Transformer) SetOutputIDs(_ []string)

SetOutputIDs will do nothing.

func (*Transformer) SetOutputs added in v0.53.0

func (t *Transformer) SetOutputs(operators []operator.Operator) error

SetOutputs will set the outputs of the router operator.

Jump to

Keyboard shortcuts

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