rest

package module
v0.0.0-...-a905a01 Latest Latest
Warning

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

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

README

App Trigger

This trigger provides your flogo application the ability to start an action on the Lifecycle events of the application. The handler associated with the STARTUP event gets invoked before all other triggers have been started. The handler associated with the SHUTDOWN event gets invoked after all other triggers have been stopped.

Installation

flogo install github.com/project-flogo/contrib/trigger/app

Configuration

Handler Settings:
Name Type Description
lifecycle string The lifecycle event (ie. STARTUP,SHUTDOWN) - REQUIRED

Example

Configure the trigger in order to have a special startup and cleanup action for your application.

{
  "triggers": [
    {
      "id": "flogo-app",
      "ref": "github.com/project-flogo/contrib/trigger/app",
      "handlers": [
        {
          "settings": {
            "lifecycle": "STARTUP"
          },
          "action": {
            "ref": "github.com/project-flogo/flow",
            "settings": {
              "flowURI": "res://flow:app_startup"
            }
          }
        },
        {
          "settings": {
            "lifecycle": "SHUTDOWN"
          },
          "action": {
            "ref": "github.com/project-flogo/flow",
            "settings": {
              "flowURI": "res://flow:app_cleanup"
            }
          }
        }
      ]
    }
  ]
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
}

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 {
	Lifecycle string `md:"lifecycle,required,allowed(STARTUP,SHUTDOWN)"`
}

type Trigger

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

Trigger REST trigger struct

func (*Trigger) Initialize

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

func (*Trigger) OnShutdown

func (t *Trigger) OnShutdown() error

func (*Trigger) OnStartup

func (t *Trigger) OnStartup() error

func (*Trigger) Start

func (t *Trigger) Start() error

func (*Trigger) Stop

func (t *Trigger) Stop() error

Stop implements util.Managed.Stop

Jump to

Keyboard shortcuts

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