plugin

package
v0.43.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PluginTypeName

func PluginTypeName(pluginType PluginType) string

func PopulateCmdlineOptions

func PopulateCmdlineOptions(fs *pflag.FlagSet) error

func ProcessConfig

func ProcessConfig(
	pluginConfig map[string]map[string]map[any]any,
) error

func ProcessEnvVars

func ProcessEnvVars() error

func Register

func Register(pluginEntry PluginEntry)

Types

type Logger

type Logger interface {
	Info(string, ...any)
	Warn(string, ...any)
	Debug(string, ...any)
	Error(string, ...any)
}

Logger provides a logging interface for plugins.

type Plugin

type Plugin interface {
	Start() error
	Stop() error
	ErrorChan() <-chan error
	InputChan() chan<- event.Event
	OutputChan() <-chan event.Event
}

Plugin represents a pluggable component in the pipeline. Plugins own their error channel; the pipeline reads from it.

func GetPlugin

func GetPlugin(pluginType PluginType, name string) Plugin

type PluginEntry

type PluginEntry struct {
	NewFromOptionsFunc func() Plugin
	Name               string
	Description        string
	Options            []PluginOption
	Type               PluginType
}

func GetPlugins

func GetPlugins(pluginType PluginType) []PluginEntry

type PluginOption

type PluginOption struct {
	DefaultValue any
	Dest         any
	Name         string
	CustomEnvVar string
	CustomFlag   string
	Description  string
	Type         PluginOptionType
}

func (*PluginOption) AddToFlagSet

func (p *PluginOption) AddToFlagSet(
	fs *pflag.FlagSet,
	pluginType string,
	pluginName string,
) error

func (*PluginOption) ProcessConfig

func (p *PluginOption) ProcessConfig(
	pluginData map[any]any,
) error

func (*PluginOption) ProcessEnvVars

func (p *PluginOption) ProcessEnvVars(envPrefix string) error

type PluginOptionType

type PluginOptionType int
const (
	PluginOptionTypeString PluginOptionType = 1
	PluginOptionTypeBool   PluginOptionType = 2
	PluginOptionTypeInt    PluginOptionType = 3
	PluginOptionTypeUint   PluginOptionType = 4
)

type PluginType

type PluginType int
const (
	PluginTypeInput  PluginType = 1
	PluginTypeOutput PluginType = 2
	PluginTypeFilter PluginType = 3
)

Jump to

Keyboard shortcuts

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