cron

package
v0.0.0-...-8dddb6f Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

README

Cron trigger

This trigger provides your flogo application the ability to start a flow via a timer configured by a cron expression.

It uses the library https://github.com/robfig/cron

Installation

Flogo Web
Start

Start a container of Flogo Web UI :

docker run --name flogo -it -d -p 3303:3303 -e FLOGO_NO_ENGINE_RECREATION=false flogo/flogo-docker eula-accept

The environment variable FLOGO_NO_ENGINE_RECREATION=false allows to force import of installed contributions.

Installation of the activity

To install the activity into the started container :

docker exec -it flogo sh -c 'cd /tmp/flogo-web/build/server/local/engines/flogo-web && flogo install github.com/square-it/flogo-contrib-triggers/cron'

Restart the container

docker restart flogo
Flogo CLI
flogo install github.com/square-it/flogo-contrib-triggers/cron

Schema

Inputs and Outputs:

{
  "settings": [
    {
      "name": "expression",
      "type": "string"
    }
  ]
}

Settings

Setting Required Description
expression True The cron expression.

Cron Expression

A cron expression represents a set of times, using 6 space-separated fields.

Field name Mandatory? Allowed values Allowed special characters
Seconds Yes 0-59 * / , -
Minutes Yes 0-59 * / , -
Hours Yes 0-23 * / , -
Day of month Yes 1-31 * / , - ?
Month Yes 1-12 or JAN-DEC * / , -
Day of week Yes 0-6 or SUN-SAT * / , - ?

See the full documentation : https://godoc.org/github.com/robfig/cron

Example

{
      "id": "cron",
      "ref": "github.com/square-it/flogo-contrib-triggers/cron",
      "name": "Cron",
      "description": "Timer trigger with cron abilities",
      "settings": {
        "expression": "0/10 * * * * *"
      }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

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

NewFactory create a new Trigger factory

Types

type CronTrigger

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

CronTrigger is a stub for your Trigger implementation

func (*CronTrigger) Initialize

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

Initialize implements trigger.Init.Initialize

func (*CronTrigger) Metadata

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

Metadata implements trigger.Trigger.Metadata

func (*CronTrigger) Start

func (t *CronTrigger) Start() error

Start implements trigger.Trigger.Start

func (*CronTrigger) Stop

func (t *CronTrigger) Stop() error

Stop implements trigger.Trigger.Start

type CronTriggerFactory

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

CronTriggerFactory My Trigger factory

func (*CronTriggerFactory) New

New Creates a new trigger instance for a given id

Jump to

Keyboard shortcuts

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