Documentation
¶
Overview ¶
Package tcpin contains the tcpIn node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TCPInConfig ¶
type TCPInConfig struct {
// Mode selects "listen" (accept connections on port) or
// "connect" (dial out to host:port).
Mode string `json:"mode"`
// Host is the remote host for connect mode (default 127.0.0.1).
Host string `json:"host"`
// Port is the listen port (listen mode) or remote port (connect).
Port int `json:"port"`
// TLS names a tlsConfig node in the same workflow; in connect
// mode the dialed connection is upgraded to TLS with that material.
TLS string `json:"tls"`
}
TCPInConfig holds configuration for the tcpIn node.
type TCPInNode ¶
TCPInNode receives raw TCP data — either by listening for inbound connections or by connecting to a remote host. Each received line (bufio scanner) is emitted downstream as Data with the remote ip/port in Metadata. Accepted connections are registered in the workflow's shared tcpSessions map for tcpOut reply mode.
func NewTCPInNode ¶
func NewTCPInNode(node nodestore.NodeInterface, config *TCPInConfig, host nodebase.NodeHost) *TCPInNode
NewTCPInNode creates a new tcpIn node
func (*TCPInNode) Execute ¶
func (n *TCPInNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute activates the node: listen mode binds a socket and spawns an accept loop; connect mode dials and starts one reader goroutine.