cli

package
v0.5.1 Latest Latest
Warning

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

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

README

tibco-cli

This trigger provides your flogo application the ability to start a flow via REST over HTTP

Installation

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

Schema

Settings, Outputs and Endpoint:

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

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) Init

func (t *CliTrigger) Init(runner action.Runner)

func (*CliTrigger) Invoke

func (t *CliTrigger) Invoke(actionId string, handlerCfg *trigger.HandlerConfig, 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