filterengine

package
v0.14.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultFilterEngine

type DefaultFilterEngine struct {
	// contains filtered or unexported fields
}

DefaultFilterEngine is a default implementation of the Filter Engine.

func New added in v0.13.0

New creates new DefaultFilterEngine instance..

func WithAllFilters added in v0.13.0

func WithAllFilters(logger *logrus.Logger, dynamicCli dynamic.Interface, mapper meta.RESTMapper, cfg config.Filters) *DefaultFilterEngine

WithAllFilters returns new DefaultFilterEngine instance with all filters registered.

func (*DefaultFilterEngine) Register added in v0.13.0

func (f *DefaultFilterEngine) Register(filters ...RegisteredFilter)

Register filter(s) to engine.

func (*DefaultFilterEngine) RegisteredFilters added in v0.13.0

func (f *DefaultFilterEngine) RegisteredFilters() []RegisteredFilter

RegisteredFilters returns sorted slice of registered filters.

func (*DefaultFilterEngine) Run added in v0.13.0

Run runs the registered filters always iterating over a slice of filters with sorted keys.

func (*DefaultFilterEngine) SetFilter added in v0.13.0

func (f *DefaultFilterEngine) SetFilter(name string, flag bool) error

SetFilter sets filter value in FilterMap to enable or disable filter.

type Filter

type Filter interface {
	Run(context.Context, *events.Event) error
	Name() string
	Describe() string
}

Filter defines an event filter.

type FilterEngine

type FilterEngine interface {
	Run(context.Context, events.Event) events.Event
	Register(...RegisteredFilter)
	RegisteredFilters() []RegisteredFilter
	SetFilter(string, bool) error
}

FilterEngine has methods to register and run filters.

type RegisteredFilter added in v0.13.0

type RegisteredFilter struct {
	Enabled bool
	Filter
}

RegisteredFilter contains details about registered filter.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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