rbe

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type RBENode struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

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

func NewRBENode(node nodestore.NodeInterface, config *RBEConfig, host nodebase.NodeHost) *RBENode

NewRBENode creates a new rbe node

func (*RBENode) Execute

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.

Jump to

Keyboard shortcuts

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