filter

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type All

type All struct {
}

All filter plugin This filter passes all messages. Configuration example

  • "stream.Broadcast": Filter: "filter.All"

func (*All) Accepts

func (filter *All) Accepts(msg core.Message) bool

Accepts allows all messages

func (*All) Configure

func (filter *All) Configure(conf core.PluginConfig) error

Configure initializes this filter with values from a plugin config.

type JSON

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

JSON filter plugin This plugin allows filtering of JSON messages by looking at certain fields. Note that this filter is quite expensive due to JSON marshaling and regexp testing of every message passing through it. Configuration example

  • "stream.Broadcast": Filter: "filter.JSON" FilterReject: "command" : "state\d\..*" FilterAccept: "args/results[0]value" : "true" "args/results[1]" : "true" "command" : "state\d\..*"

FilterReject defines fields that will cause a message to be rejected if the given regular expression matches. Rejects are checked before Accepts. Field paths can be defined in a format accepted by shared.MarshalMap.Path.

FilterAccept defines fields that will cause a message to be rejected if the given regular expression does not match. Field paths can be defined in a format accepted by shared.MarshalMap.Path.

func (*JSON) Accepts

func (filter *JSON) Accepts(msg core.Message) bool

Accepts checks JSON field values and rejects messages after testing a blacklist and a whitelist.

func (*JSON) Configure

func (filter *JSON) Configure(conf core.PluginConfig) error

Configure initializes this filter with values from a plugin config.

type None

type None struct {
}

None filter plugin This plugin blocks all messages. Configuration example

  • "stream.Broadcast": Filter: "filter.None"

func (*None) Accepts

func (filter *None) Accepts(msg core.Message) bool

Accepts allows all messages

func (*None) Configure

func (filter *None) Configure(conf core.PluginConfig) error

Configure initializes this filter with values from a plugin config.

type Rate added in v0.4.3

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

Rate filter plugin This plugin blocks messages after a certain number of messages per second has been reached. Configuration example

  • "stream.Broadcast": Filter: "filter.Rate" RateLimitPerSec: 100 RateLimitDropToStream: "" RateLimitIgnore:
  • "foo"

RateLimitPerSec defines the maximum number of messages per second allowed to pass through this filter. By default this is set to 100.

RateLimitDropToStream is an optional stream messages are sent to when the limit is reached. By default this is disabled and set to "".

RateLimitIgnore defines a list of streams that should not be affected by rate limiting. This is usefull for e.g. producers listeing to "*". By default this list is empty.

func (*Rate) Accepts added in v0.4.3

func (filter *Rate) Accepts(msg core.Message) bool

Accepts allows all messages

func (*Rate) Configure added in v0.4.3

func (filter *Rate) Configure(conf core.PluginConfig) error

Configure initializes this filter with values from a plugin config.

type RegExp

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

RegExp filter plugin This plugin allows filtering messages using regular expressions. Configuration example

  • "stream.Broadcast": Filter: "filter.RegExp" FilterExpression: "\d+-.*" FilterExpressionNot: "\d+-.*"

FilterExpression defines the regular expression used for matching the message payload. If the expression matches, the message is passed. FilterExpression is evaluated after FilterExpressionNot.

FilterExpressionNot defines a negated regular expression used for matching the message payload. If the expression matches, the message is blocked. FilterExpressionNot is evaluated before FilterExpression.

func (*RegExp) Accepts

func (filter *RegExp) Accepts(msg core.Message) bool

Accepts allows all messages

func (*RegExp) Configure

func (filter *RegExp) Configure(conf core.PluginConfig) error

Configure initializes this filter with values from a plugin config.

type Stream added in v0.4.0

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

Stream filter plugin This plugin filters messages by stream based on a black and a whitelist. The blacklist is checked first. Configuration example

  • "stream.Broadcast": Filter: "filter.Stream" FilterBlockStreams:
  • "foo" FilterOnlyStreams:
  • "test1"
  • "test2"

FilterBlockStreams sets a list of streams that are blocked. If a message's stream is not in that list, the OnlyStreams list is tested. This list ist empty by default.

FilterOnlyStreams sets a list of streams that may pass. Messages from streams that are not in this list are blocked unless the list is empty. By default this list is empty.

func (*Stream) Accepts added in v0.4.0

func (filter *Stream) Accepts(msg core.Message) bool

Accepts filters by streamId using a black and whitelist

func (*Stream) Configure added in v0.4.0

func (filter *Stream) Configure(conf core.PluginConfig) error

Configure initializes this filter with values from a plugin config.

Jump to

Keyboard shortcuts

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