trigger

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTrigger

func CreateTrigger(typeName string, param map[string]interface{}) (interface{}, error)

CreateTrigger create a new trigger

Types

type Cron

type Cron struct {
	util.BaseLogger
	Spec        string
	WithSeconds bool
}

Cron is a trigger which will be active according to the spec

func (*Cron) Run

func (tgr *Cron) Run(ctx context.Context, sendParam func(map[string]interface{}))

Run the Cron trigger

type HTTP

type HTTP struct {
	util.HTTPServer
}

HTTP is a trigger which will listen to http request

func (*HTTP) Run

func (tgr *HTTP) Run(ctx context.Context, sendParam func(map[string]interface{}))

Run the HTTP trigger

type Tick

type Tick struct {
	Interval time.Duration
}

Tick is a trigger which will be active periodically

func (*Tick) Run

func (tgr *Tick) Run(ctx context.Context, sendParam func(map[string]interface{}))

Run the Tick trigger

Jump to

Keyboard shortcuts

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