Documentation
¶
Overview ¶
Package udpout contains the udpOut node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UDPOutConfig ¶
type UDPOutConfig struct {
// Addr is the Node-RED target address field; overridden by
// message Metadata["ip"] when present. Host is the legacy alias.
Addr string `json:"addr"`
// Host is the legacy target field (default 127.0.0.1).
Host string `json:"host"`
// Port is the target port; overridden by message
// Metadata["port"] when present.
Port int `json:"port"`
// IPv selects the socket family: "udp4" (default) | "udp6".
IPv string `json:"ipv"`
// Outport binds a fixed local port; 0 picks a random one.
Outport int `json:"outport"`
// Base64 decodes a base64 payload string before sending.
Base64 bool `json:"base64"`
// Multicast selects the send flavor: "false" (datagram),
// "broad" (broadcast — defaults the address to 255.255.255.255)
// or "multi" (multicast to the group address).
Multicast string `json:"multicast"`
// Iface names the local interface for multicast sends.
Iface string `json:"iface"`
}
UDPOutConfig holds configuration for the udpOut node.
type UDPOutNode ¶
UDPOutNode sends the message Data as a UDP datagram to the configured host:port, or to the message's Metadata ip/port when present (e.g. answering a udpIn sender).
func NewUDPOutNode ¶
func NewUDPOutNode(node nodestore.NodeInterface, config *UDPOutConfig) *UDPOutNode
NewUDPOutNode creates a new udpOut node
func (*UDPOutNode) Execute ¶
func (n *UDPOutNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute resolves the target address (metadata wins) and sends one datagram; the input passes through unchanged.
func (*UDPOutNode) Validate ¶
func (n *UDPOutNode) Validate() error
Validate checks the udpOut node configuration