Help us shape the future of Go! Take the 2026 Go Developer Survey

filters

package
v1.27.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: GPL-3.0 Imports: 59 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

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

Base is inherited from the feeders

func (*Base) GetIdentifier

func (f *Base) GetIdentifier() string

GetIdentifier returns the Node identifier ID used in the bus

func (*Base) Log added in v0.8.2

func (f *Base) Log(format string, args ...interface{})

Log print a debug line prepending the name of the rule and of the filter

func (*Base) Name

func (f *Base) Name() string

Name returns the Filter's name

func (*Base) Pipe

func (f *Base) Pipe(msg *data.Message)

Pipe gets a Message from the previous Node and Propagate it to the next one if the Filter's callback will return true

func (*Base) Propagate

func (f *Base) Propagate(data *data.Message)

Propagate sends the Message to the connected Filters

func (*Base) Rule

func (f *Base) Rule() string

Rule returns the rule in which the Filter is found

type Cache

type Cache struct {
	sync.Mutex
	Base
	// contains filtered or unexported fields
}

Cache handles a cache usable in the rule

func (*Cache) DoFilter

func (f *Cache) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Cache) OnEvent added in v1.3.1

func (f *Cache) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Changed

type Changed struct {
	sync.Mutex
	Base
	// contains filtered or unexported fields
}

Changed is a Filter that call the propagation method only if the input Message is different from the previous one

func (*Changed) DoFilter

func (f *Changed) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Changed) OnEvent added in v1.3.1

func (f *Changed) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Echo

type Echo struct {
	Base
	// contains filtered or unexported fields
}

Echo is a filter that print the input Message on the logs.

func (*Echo) DoFilter

func (f *Echo) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Echo) OnEvent added in v1.3.1

func (f *Echo) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type ElasticSearch added in v1.8.2

type ElasticSearch struct {
	Base
	// contains filtered or unexported fields
}

ElasticSearch is a filter that imports JSON documents in an Elastsic Search database.

func (*ElasticSearch) DoFilter added in v1.8.2

func (f *ElasticSearch) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*ElasticSearch) OnEvent added in v1.8.2

func (f *ElasticSearch) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type File added in v1.8.2

type File struct {
	Base
	// contains filtered or unexported fields
}

File is a filter that interprets the input Message as a file path, reads it and prints it.

func (*File) DoFilter added in v1.8.2

func (f *File) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*File) OnEvent added in v1.8.2

func (f *File) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Filter

type Filter interface {
	Rule() string
	Name() string
	DoFilter(msg *data.Message) (bool, error)
	Pipe(msg *data.Message)
	GetIdentifier() string
	Log(format string, args ...interface{})
	OnEvent(e *data.Event)
	// contains filtered or unexported methods
}

Filter defines Base methods of the object

func NewCacheFilter

func NewCacheFilter(p map[string]string) (Filter, error)

NewCacheFilter is the registered method to instantiate a CacheFilter

func NewChangedFilter

func NewChangedFilter(p map[string]string) (Filter, error)

NewChangedFilter is the registered method to instantiate a ChangedFilter

func NewEchoFilter

func NewEchoFilter(p map[string]string) (Filter, error)

NewEchoFilter is the registered method to instantiate a EchoFilter

func NewElasticSearchFilter added in v1.8.2

func NewElasticSearchFilter(p map[string]string) (Filter, error)

NewElasticSearchFilter is the registered method to instantiate a ElasticSearchFilter

func NewFileFilter added in v1.8.2

func NewFileFilter(params map[string]string) (Filter, error)

NewFileFilter is the registered method to instantiate a File filter

func NewFilter

func NewFilter(rule string, name string, conf map[string]string, bus EventBus.Bus, id int32, neg bool) (Filter, error)

NewFilter creates a new registered Filter from it's name

func NewFormatFilter

func NewFormatFilter(p map[string]string) (Filter, error)

NewFormatFilter is the registered method to instantiate a FormatFilter

func NewHTMLFilter added in v1.14.0

func NewHTMLFilter(p map[string]string) (Filter, error)

NewHTMLFilter is the registered method to instantiate a HtmlFilter

func NewHTTPFilter

func NewHTTPFilter(p map[string]string) (Filter, error)

NewHTTPFilter is the registered method to instantiate a HttpFilter

func NewHashFilter

func NewHashFilter(p map[string]string) (Filter, error)

NewHashFilter is the registered method to instantiate a HashFilter

func NewJSONFilter added in v1.20.0

func NewJSONFilter(p map[string]string) (Filter, error)

NewJSONFilter is the registered method to instantiate a JSONFilter

func NewJsFilter

func NewJsFilter(p map[string]string) (Filter, error)

NewJsFilter is the registered method to instantiate a JsFilter

func NewLLMFilter added in v1.26.8

func NewLLMFilter(p map[string]string) (Filter, error)

NewLLMFilter is the registered method to instantiate an LLMFilter

func NewMailFilter

func NewMailFilter(p map[string]string) (Filter, error)

NewMailFilter is the registered method to instantiate a MailFilter

func NewMimetypeFilter added in v0.8.1

func NewMimetypeFilter(p map[string]string) (Filter, error)

NewMimetypeFilter is the registered method to instantiate a MimetypeFilter

func NewNumberFilter added in v1.26.8

func NewNumberFilter(p map[string]string) (Filter, error)

NewNumberFilter is the registered method to instantiate a TextFilter

func NewOverrideFilter

func NewOverrideFilter(p map[string]string) (Filter, error)

NewOverrideFilter is the registered method to instantiate a OverrideFilter

func NewPDFFilter added in v0.8.1

func NewPDFFilter(p map[string]string) (Filter, error)

NewPDFFilter is the registered method to instantiate a TextFilter

func NewRandomFilter added in v0.8.2

func NewRandomFilter(p map[string]string) (Filter, error)

NewRandomFilter is the registered method to instantiate a RandomFilter

func NewRateLimitFilter added in v1.20.0

func NewRateLimitFilter(p map[string]string) (Filter, error)

NewRateLimitFilter is the registered method to instantiate a RateLimit Filter

func NewSlackFilter added in v0.9.1

func NewSlackFilter(p map[string]string) (Filter, error)

NewSlackFilter is the registered method to instantiate a MailFilter

func NewStripTagFilter added in v1.4.0

func NewStripTagFilter(p map[string]string) (Filter, error)

NewStripTagFilter is the registered method to instantiate a StripTagFilter

func NewSystemFilter

func NewSystemFilter(p map[string]string) (Filter, error)

NewSystemFilter is the registered method to instantiate a SystemFilter

func NewTelegramBotFilter added in v1.27.0

func NewTelegramBotFilter(p map[string]string) (Filter, error)

NewTelegramBotFilter is the registered method to instantiate a TelegramBot filter.

func NewTelegramFilter added in v1.26.8

func NewTelegramFilter(p map[string]string) (Filter, error)

NewTelegramFilter is the registered method to instantiate a MailFilter

func NewTextFilter

func NewTextFilter(p map[string]string) (Filter, error)

NewTextFilter is the registered method to instantiate a TextFilter

func NewURLFilter

func NewURLFilter(p map[string]string) (Filter, error)

NewURLFilter is the registered method to instantiate a UrlFilter

func NewXLSFilter added in v1.20.0

func NewXLSFilter(p map[string]string) (Filter, error)

NewXLSFilter is the registered method to instantiate a XLSFilter

type FilterFactory

type FilterFactory func(conf map[string]string) (Filter, error)

FilterFactory identifies a function to instantiate a Filter using the Factory

type Format

type Format struct {
	Base
	// contains filtered or unexported fields
}

Format is a Filter that apply a Golang Template to the input Message and propagate it to the next Filter

func (*Format) DoFilter

func (f *Format) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Format) OnEvent added in v1.3.1

func (f *Format) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type HTML added in v1.14.0

type HTML struct {
	Base
	// contains filtered or unexported fields
}

HTML is a filter to parse the HTML format

func (*HTML) DoFilter added in v1.14.0

func (f *HTML) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*HTML) OnEvent added in v1.14.0

func (f *HTML) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type HTTP

type HTTP struct {
	Base
	// contains filtered or unexported fields
}

HTTP is a filter to handle http requests using the input Message

func (*HTTP) DoFilter

func (f *HTTP) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*HTTP) OnEvent added in v1.3.1

func (f *HTTP) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Hash

type Hash struct {
	Base
	// contains filtered or unexported fields
}

Hash is a Filter that searches for hashes in the Message

func (*Hash) DoFilter

func (f *Hash) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Hash) OnEvent added in v1.3.1

func (f *Hash) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type JSON added in v1.20.0

type JSON struct {
	Base
	// contains filtered or unexported fields
}

JSON is a filter to parse the JSON format

func (*JSON) DoFilter added in v1.20.0

func (f *JSON) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*JSON) OnEvent added in v1.20.0

func (f *JSON) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Js

type Js struct {
	Base
	// contains filtered or unexported fields
}

Js is a Filter that load a plugin written in Javascript to create a custom Filter

func (*Js) DoFilter

func (f *Js) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Js) OnEvent added in v1.3.1

func (f *Js) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type LLM added in v1.26.8

type LLM struct {
	Base
	// contains filtered or unexported fields
}

LLM is a Filter that sends the input Message to a Large Language Model and propagates the response. It uses github.com/mozilla-ai/any-llm-go to support multiple LLM providers (OpenAI, Anthropic, Ollama, DeepSeek, Groq, Mistral, Gemini, llama.cpp, Llamafile).

func (*LLM) DoFilter added in v1.26.8

func (f *LLM) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*LLM) OnEvent added in v1.26.8

func (f *LLM) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Mail

type Mail struct {
	Base
	// contains filtered or unexported fields
}

Mail is a Filter to send e-mail using the input Message

func (*Mail) DoFilter

func (f *Mail) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Mail) OnEvent added in v1.3.1

func (f *Mail) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Mimetype added in v0.8.1

type Mimetype struct {
	Base
	// contains filtered or unexported fields
}

Mimetype is a Filter to detect the format of an input

func (*Mimetype) DoFilter added in v0.8.1

func (f *Mimetype) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Mimetype) OnEvent added in v1.3.1

func (f *Mimetype) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Number added in v1.26.8

type Number struct {
	Base
	// contains filtered or unexported fields
}

Number is a Filter to treat a string from the input Message as numeric value and apply some operator on it

func (*Number) DoFilter added in v1.26.8

func (f *Number) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Number) OnEvent added in v1.26.8

func (f *Number) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Override

type Override struct {
	Base
	// contains filtered or unexported fields
}

Override is a Filter that allow to change the current Message before to send it to the next Filter

func (*Override) DoFilter

func (f *Override) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Override) OnEvent added in v1.3.1

func (f *Override) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type PDF added in v0.8.1

type PDF struct {
	Base
	// contains filtered or unexported fields
}

PDF is a Filter that extract plain text from a PDF file

func (*PDF) DoFilter added in v0.8.1

func (f *PDF) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*PDF) OnEvent added in v1.3.1

func (f *PDF) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Random added in v0.8.2

type Random struct {
	Base
	// contains filtered or unexported fields
}

Random is a Filter to create a random number

func (*Random) DoFilter added in v0.8.2

func (f *Random) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Random) OnEvent added in v1.3.1

func (f *Random) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type RateLimit added in v1.20.0

type RateLimit struct {
	Base
	// contains filtered or unexported fields
}

RateLimit is a Filter to create a RateLimit number

func (*RateLimit) DoFilter added in v1.20.0

func (f *RateLimit) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*RateLimit) OnEvent added in v1.20.0

func (f *RateLimit) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Slack added in v0.9.1

type Slack struct {
	Base
	// contains filtered or unexported fields
}

Slack is a Filter to send message, file to a slack channel

func (*Slack) DoFilter added in v0.9.1

func (f *Slack) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Slack) OnEvent added in v1.3.1

func (f *Slack) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type StripTag added in v1.4.0

type StripTag struct {
	Base
	// contains filtered or unexported fields
}

StripTag is a filter that removes HTML tags from a text.

func (*StripTag) DoFilter added in v1.4.0

func (f *StripTag) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*StripTag) OnEvent added in v1.4.0

func (f *StripTag) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type System

type System struct {
	Base
	// contains filtered or unexported fields
}

System is a Filter to exec a command on the host machine using the input Message

func (*System) DoFilter

func (f *System) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*System) OnEvent added in v1.3.1

func (f *System) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Telegram added in v1.26.8

type Telegram struct {
	Base
	// contains filtered or unexported fields
}

Telegram is a Filter to send message, file to Telegram

func (*Telegram) DoFilter added in v1.26.8

func (f *Telegram) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Telegram) OnEvent added in v1.26.8

func (f *Telegram) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type TelegramBot added in v1.27.0

type TelegramBot struct {
	Base
	// contains filtered or unexported fields
}

TelegramBot is a Filter to perform Bot API actions on top of the telegrambot feeder.

func (*TelegramBot) DoFilter added in v1.27.0

func (f *TelegramBot) DoFilter(msg *data.Message) (bool, error)

DoFilter dispatches by action.

func (*TelegramBot) OnEvent added in v1.27.0

func (f *TelegramBot) OnEvent(event *data.Event)

OnEvent is called when an event occurs.

type Text

type Text struct {
	Base
	// contains filtered or unexported fields
}

Text is a Filter to search and extract strings from the input Message

func (*Text) DoFilter

func (f *Text) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Text) OnEvent added in v1.3.1

func (f *Text) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type URL

type URL struct {
	Base
	// contains filtered or unexported fields
}

URL is a Filter to search urls in the input Message

func (*URL) DoFilter

func (f *URL) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*URL) OnEvent added in v1.3.1

func (f *URL) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type XLS added in v1.20.0

type XLS struct {
	Base
	// contains filtered or unexported fields
}

XLS is a Filter that extract all the rows from an Excel file

func (*XLS) DoFilter added in v1.20.0

func (f *XLS) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*XLS) OnEvent added in v1.20.0

func (f *XLS) OnEvent(event *data.Event)

OnEvent is called when an event occurs

Jump to

Keyboard shortcuts

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