Documentation
¶
Overview ¶
Package rbe contains the rbe node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RBEConfig ¶
type RBEConfig struct {
// Func is the comparison mode:
// rbe — pass when the value changes (first message passes)
// rbei — like rbe but the first (initial) message is blocked
// narrowband — pass while at-or-within gap of the last passed value
// narrowbandEq — pass while strictly within gap
// deadband — pass once the value moved by more than gap
// deadbandEq — pass once the value moved by gap or more
Func string `json:"func"`
// Property is the dotted path into the payload; "payload" (the
// default) targets the whole payload
Property string `json:"property"`
// Gap is the deadband/narrowband threshold; a trailing "%" turns it
// into a percentage of the last passed value
Gap string `json:"gap"`
// SepTopics keeps a separate previous value per message topic
SepTopics bool `json:"septopics"`
// Start / InitialValue seed the previous value before any message
Start string `json:"start"`
InitialValue string `json:"initialValue"`
}
RBEConfig holds configuration for the rbe node — the Node-RED report-by-exception equivalent.
type RBENode ¶
RBENode forwards a message only when the watched property changed (or moved beyond the configured deadband) relative to the last value it passed — the Node-RED rbe equivalent.
func NewRBENode ¶
NewRBENode creates a new rbe node
func (*RBENode) Execute ¶
func (n *RBENode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute compares the watched property against the last passed value for the message's topic. Non-passing messages are dropped (nil, nil). A "reset" key in Metadata clears the stored state first.