Documentation
¶
Overview ¶
Package websocketout contains the websocketOut node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WebSocketOutConfig ¶
type WebSocketOutConfig struct {
// Target selects "session" (write back on the connection named by
// the message's sessionId metadata) or "broadcast" (write to every
// open session of this workflow's websocketIn nodes). Only used in
// legacy mode — a server/client reference overrides it.
Target string `json:"target"`
// Server references a shared websocketListener config node id
// (Node-RED "server"): writes go to the session named by the
// message's sessionId metadata, or to every client of the shared
// endpoint when no session is named.
Server string `json:"server"`
// Client references a shared websocketClient config node id
// (Node-RED "client"): writes go over the shared outbound
// connection. Client wins over Server.
Client string `json:"client"`
}
WebSocketOutConfig holds configuration for the websocketOut node.
type WebSocketOutNode ¶
WebSocketOutNode writes the message Data to websocket sessions held in the workflow's shared WSSessions registry.
func NewWebSocketOutNode ¶
func NewWebSocketOutNode(node nodestore.NodeInterface, config *WebSocketOutConfig, host nodebase.NodeHost) *WebSocketOutNode
NewWebSocketOutNode creates a new websocketOut node
func (*WebSocketOutNode) Activate ¶ added in v0.7.0
func (n *WebSocketOutNode) Activate(ctx context.Context) error
Activate warms the shared config resources at deploy time: a server reference mounts the listener endpoint now (clients must be able to connect before the first message arrives); a client reference starts the dial-retry loop.
func (*WebSocketOutNode) Execute ¶
func (n *WebSocketOutNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute writes Data as a text message (binary for []byte) to the selected session(s) and returns the input unchanged.
func (*WebSocketOutNode) Stop ¶ added in v0.7.0
func (n *WebSocketOutNode) Stop() error
Stop releases the shared config resources (idempotent).
func (*WebSocketOutNode) Validate ¶
func (n *WebSocketOutNode) Validate() error
Validate checks the websocketOut node configuration