filters

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: GPL-3.0 Imports: 31 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

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

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

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{})
	// 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 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 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 NewJsFilter

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

NewJsFilter is the registered method to instantiate a JsFilter

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 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 NewSlackFilter added in v0.9.1

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

NewSlackFilter is the registered method to instantiate a MailFilter

func NewSystemFilter

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

NewSystemFilter is the registered method to instantiate a SystemFilter

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Jump to

Keyboard shortcuts

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