conditional

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ARGS map[string]interface{}

Functions

This section is empty.

Types

type Config

type Config struct {
	// Condition to produce metric
	// See syntax here: https://expr-lang.org/docs/language-definition
	Condition string `toml:"condition"`
}

Config is a struct that define output condition expression.

type Expression

type Expression interface {
	// Match test if the event match the conditional expression
	Match(event events.Event) bool
	// String returns condition as text
	String() string
}

Serializer is an interface defining functions that a serializer plugin must satisfy.

func NewConditionalExpression

func NewConditionalExpression(config *Config) (Expression, error)

NewConditionalExpression creat a conditional Output interface based on the given config.

type Output

type Output interface {
	// SetCondition sets the condition expression for the interface.
	SetCondition(condition Expression)
}

Output is an interface for output plugins that are conditioned to an expression.

Jump to

Keyboard shortcuts

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