-
Notifications
You must be signed in to change notification settings - Fork 0
/
runner.go
50 lines (43 loc) · 1.19 KB
/
runner.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
45
46
47
48
49
50
package ingest
// Runner is an interface which can be processed by a pipeline
type Runner interface {
Name() string
Run(*Stage) error
}
// HasDefaultOptions is an interface which a Runner can implement
// that allows it to specify default ThenOpts
type HasDefaultOptions interface {
Runner
DefaultOpts() ThenOpts
}
// OnAdd is an interface which a Runner can implement
// to allow it to hook in to being added to the pipeline
type OnAdd interface {
Runner
OnAdd(prevRunner Runner)
}
// PassOnAddTarget is an interface which a Runner can implement
// to cause OnAdd hooks that would target it to target the previous
// targetable interface
type PassOnAddTarget interface {
Runner
PassOnAddTarget() bool
}
// OnDone is an interface which a Runner can implement
// to allow it to run code after the pipeline has completed running fully
type OnDone interface {
Runner
OnPipelineDone() error
}
// NoOpRunner allows a runner to specify that it shouldn't be added
// to the run pipeline at add time
type NoOpRunner interface {
Runner
NoOpRunner() bool
}
// NoErrAbortRunner allows a runner to avoid having to send an error
// back on Abort
type NoErrAbortRunner interface {
Runner
SkipAbortErr() bool
}