skip

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2017 License: BSD-3-Clause Imports: 7 Imported by: 0

README

skip function

skip() will evalute the data based on the criteria configured and determine whether the message should continue down the pipeline or be skipped. When evaluating the data, true will result in the message being sent down the pipeline and false will result in the message being skipped. Take a look at the tests for all currently supported configurations. It currently only works for top level fields (i.e. address.street would not work).

configuration
skip({"field": "test", "operator": "==", "match": 10})
example

message in

{
    "_id": 0,
    "name": "transporter",
    "type": "function",
    "count": 10
}

config

skip({"field": "count", "operator": "==", "match": 10})

message out

{
    "_id": 0,
    "name": "transporter",
    "type": "function",
    "count": 10
}

config

skip({"field": "count", "operator": ">", "match": 20})

message would be skipped

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Skip

type Skip struct {
	Field    string      `json:"field"`
	Operator string      `json:"operator"`
	Match    interface{} `json:"match"`
}

func (*Skip) Apply

func (s *Skip) Apply(msg message.Msg) (message.Msg, error)

type UnknownOperatorError

type UnknownOperatorError struct {
	Op string
}

func (UnknownOperatorError) Error

func (e UnknownOperatorError) Error() string

type WrongTypeError

type WrongTypeError struct {
	Wanted string
	Got    string
}

func (WrongTypeError) Error

func (e WrongTypeError) Error() string

Jump to

Keyboard shortcuts

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