cli

package
v0.5.2-rc4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2018 License: BSD-3-Clause Imports: 8 Imported by: 0

README

tibco-cli

This trigger provides your flogo application the ability to run as a CLI app, that is, accept input via the CLI & run once till completion and return the results to stdout.

Installation

flogo install github.com/TIBCOSoftware/flogo-contrib/trigger/cli

Schema

Settings, Outputs and Endpoint:

{
  "output": [
    {
      "name": "args",
      "type": "array"
    }
  ],
  "handler": {
    "settings": [
      {
        "name": "command",
        "type": "string"
      },
      {
        "name": "default",
        "type": "boolean"
      }
    ]
  }
}

Settings

Trigger:
Output Description
args The array of arguments
Handler:
Setting Description
command The command invoked
default Indicates if its the default command

Example Configurations

Triggers are configured via the triggers section of your application. The following are some example configuration of the CLI Trigger.

No command

Configure the Trigger to execute one flow

{
    "triggers": [
      {
        "ref": "github.com/TIBCOSoftware/flogo-contrib/trigger/cli",
        "description": "Simple CLI trigger",
        "settings": {},
        "id": "main",
        "handlers": [
          {
            "settings": {
              "default": true
            },
            "actionId": "log_cli"
          }
        ]
      }
    ]
}
Multiple Commands

Configure the Trigger to handle multiple commands

{
    "triggers": [
      {
        "ref": "github.com/TIBCOSoftware/flogo-contrib/trigger/cli",
        "description": "Simple CLI trigger",
        "settings": {},
        "id": "main",
        "handlers": [
          {
            "settings": {
              "command": "list"
            },
            "actionId": "list_flow"
          },
          {
            "settings": {
              "command": "run"
            },
            "actionId": "run_flow"
          }
        ]
      }
    ]
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Invoke

func Invoke() (string, error)

func NewFactory

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

NewFactory create a new Trigger factory

Types

type CliTrigger

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

CliTrigger CLI trigger struct

func (*CliTrigger) Initialize added in v0.5.2

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

func (*CliTrigger) Invoke

func (t *CliTrigger) Invoke(handler *trigger.Handler, args []string) (string, error)

func (*CliTrigger) Metadata

func (t *CliTrigger) Metadata() *trigger.Metadata

Metadata implements trigger.Trigger.Metadata

func (*CliTrigger) Start

func (t *CliTrigger) Start() error

func (*CliTrigger) Stop

func (t *CliTrigger) Stop() error

Stop implements util.Managed.Stop

type CliTriggerFactory

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

CliTriggerFactory CLI Trigger factory

func (*CliTriggerFactory) New

New Creates a new trigger instance for a given id

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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