diff --git a/src/content/docs/concepts/payload.md b/src/content/docs/concepts/payload.md new file mode 100644 index 0000000..6b1e564 --- /dev/null +++ b/src/content/docs/concepts/payload.md @@ -0,0 +1,10 @@ +--- +title: Payload +sidebar: + order: 5 +--- + +[Processors](/concepts/Processors) operator on a "wrapped" version of the message produces by the module. This wrapped version is available to all processors and is defined as follows: +- **Payload**: the actual message produced by the module (or the result of the previous [processor](/concepts/processors) in the [route](/concepts/routes)). +- **Sender**: the network address of the module that produced the message (if applicable not all modules will have a sender address). +- **Modules**: a map of all [modules](/concepts/modules) in the router with the module id as the key and the module instance as the value. diff --git a/src/content/docs/processors/filter/expr.md b/src/content/docs/processors/filter/expr.md new file mode 100644 index 0000000..62b0bb0 --- /dev/null +++ b/src/content/docs/processors/filter/expr.md @@ -0,0 +1,18 @@ +--- +title: Expr Filter +sidebar: + order: 2 +--- +The `filter.expr` processor evaluates an [Expr expression](https://expr-lang.org/playground). If the expression evaluates to true then the payload is sent through. This processor will return an error if the expression fails to evaluate. + +- **type**: `filter.expr` +- **params**: + - **expression**: [Expr expression](https://expr-lang.org/playground) to evaluate. The expression has access to the [wrapped payload](/concepts/payload). + +### Example +Match a payload great than or equal to 0 +``` +- type: filter.expr + params: + pattern: "Payload >= 0" +``` \ No newline at end of file