Documentation
¶
Overview ¶
Package udpin contains the udpIn node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UDPInConfig ¶
type UDPInConfig struct {
// Port is the UDP port to listen on.
Port int `json:"port"`
// Multicast joins Group when "true" (a Node-RED enum-as-string
// field — imports serialize it as "true"/"false").
Multicast string `json:"multicast"`
// Group is the multicast group address to join.
Group string `json:"group"`
// Iface names the local interface for the multicast join.
Iface string `json:"iface"`
// IPv selects the socket family: "udp4" (default) | "udp6".
IPv string `json:"ipv"`
// Datatype selects the payload type: "utf8" (string — default,
// matching the previous always-string behavior), "buffer"
// (raw []byte) or "base64" (base64-encoded string).
Datatype string `json:"datatype"`
}
UDPInConfig holds configuration for the udpIn node.
type UDPInNode ¶
UDPInNode receives UDP datagrams. Each datagram is emitted downstream as Data (string) with the sender's ip/port in Metadata.
func NewUDPInNode ¶
func NewUDPInNode(node nodestore.NodeInterface, config *UDPInConfig, host nodebase.NodeHost) *UDPInNode
NewUDPInNode creates a new udpIn node
func (*UDPInNode) Execute ¶
func (n *UDPInNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute binds the UDP socket — or joins the multicast group when configured — and starts the datagram read loop.