tcpudp

package module
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

README

TCP/UDP Trigger

This trigger reads/writes data using TCI/UDP networks.

Flogo CLI
flogo install github.com/AiRISTAFlowInc/fs-contrib/trigger/tcpudp

Configuration

Setting :
Name Type Description
network string Network type. Supported types: tcp,tcp4,tcp6,udp,udp4,udp6 - REQUIRED
host string Host IP or DNS resolvable name
port string Port to listen on - REQUIRED
delimiter string Delimiter for read and write. If not set, trigger will read data until EOF
timeout integer Read and Write timeout in milliseconds. To disable timeout, set value to 0.
Output:
Name Type Description
data string The data received from client
Reply:
Name Type Description
reply string The data to be sent back to the client

Examples

{
  "triggers": [
          {
              "ref": "github.com/AiRISTAFlowInc/fs-contrib/trigger/tcpudp",
              "name": "ReceiveTCPData",
              "settings": {
                  "network": "tcp4",
                  "host": "localhost",
                  "port": "8999",
                  "delimiter": "\n",
                  "timeout": 200
              },
              "id": "ReceiveTCPData",
              "handlers": [
                  {
                      "settings": {},
                      "action": {
                          "ref": "github.com/AiRISTAFlowInc/fs-flow",
                          "settings": {
                              "flowURI": "res://flow:TCP"
                          },
                          "input": {
                              "data": "=$.data"
                          },
                          "output": {
                              "reply": "=$.reply"
                          }
                      },
                      "reply": {
                          "reply": ""
                      }
                  }
              ]
          }
      ]
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
}

Factory is a kafka trigger factory

func (*Factory) Metadata

func (*Factory) Metadata() *trigger.Metadata

Metadata implements trigger.Factory.Metadata

func (*Factory) New

func (*Factory) New(config *trigger.Config) (trigger.Trigger, error)

New implements trigger.Factory.New

type HandlerSettings

type HandlerSettings struct {
}

type Output

type Output struct {
	Data string `md:"data"` // The data received from the connection
}

func (*Output) FromMap

func (o *Output) FromMap(values map[string]interface{}) error

func (*Output) ToMap

func (o *Output) ToMap() map[string]interface{}

type Reply

type Reply struct {
	Reply string `md:"reply"` // The reply to be sent back
}

func (*Reply) FromMap

func (r *Reply) FromMap(values map[string]interface{}) error

func (*Reply) ToMap

func (r *Reply) ToMap() map[string]interface{}

type Settings

type Settings struct {
	Network   string `md:"network"`       // The network type
	Host      string `md:"host"`          // The host name or IP for TCP server.
	Port      string `md:"port,required"` // The port to listen on
	Delimiter string `md:"delimiter"`     // Data delimiter for read and write
	TimeOut   int    `md:"timeout"`
}

type Trigger

type Trigger struct {
	// contains filtered or unexported fields
}

Trigger is a kafka trigger

func (*Trigger) Initialize

func (t *Trigger) Initialize(ctx trigger.InitContext) error

Initialize initializes the trigger

func (*Trigger) Start

func (t *Trigger) Start() error

Start starts the kafka trigger

func (*Trigger) Stop

func (t *Trigger) Stop() error

Stop implements ext.Trigger.Stop

Jump to

Keyboard shortcuts

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