-
Notifications
You must be signed in to change notification settings - Fork 54
/
trigger.go
44 lines (33 loc) · 1009 Bytes
/
trigger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package trigger
import (
"github.com/project-flogo/core/support/log"
"github.com/project-flogo/core/support/managed"
)
// Trigger is object that triggers/starts flow instances and
// is managed by an engine
type Trigger interface {
managed.Managed
// Initialize is called to initialize the Trigger
Initialize(ctx InitContext) error
}
// InitContext is the initialization context for the trigger instance
type InitContext interface {
// Logger the logger for the trigger
Logger() log.Logger
// GetHandlers gets the handlers associated with the trigger
GetHandlers() []Handler
}
// Factory is used to create new instances of a trigger
type Factory interface {
// Metadata returns the metadata of the trigger
Metadata() *Metadata
// New create a new Trigger
New(config *Config) (Trigger, error)
}
// EventFlowControlAware trigger can be paused or resumed by the engine
type EventFlowControlAware interface {
// Resume suspended trigger
Resume() error
// Pause trigger
Pause() error
}