trigger

package
Version: v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TriggerTypeCron = "cron"
)

Variables

This section is empty.

Functions

func RegisterTrigger

func RegisterTrigger(triggerType string, trigger Trigger) error

func UnregisterTrigger

func UnregisterTrigger(triggerType string)

Types

type Executer

type Executer interface {
	Run()
}

type Manager

type Manager struct{}

func GetTriggerMgr

func GetTriggerMgr() *Manager

func (*Manager) Add

func (m *Manager) Add(ctx *context.Context, plan *model.Plan, executer Executer) error

func (*Manager) Remove

func (m *Manager) Remove(ctx *context.Context, plan *model.Plan) error

func (*Manager) Update

func (m *Manager) Update(ctx *context.Context, plan *model.Plan, executer Executer) error

type Trigger

type Trigger interface {
	Add(planId, properties string, executer Executer) error
	Remove(planId string) error
	Update(planId, properties string, executer Executer) error
}

func GetTrigger

func GetTrigger(triggerType string) Trigger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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