File tree 3 files changed +19
-7
lines changed
3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ import (
7
7
8
8
// Activity is an interface for defining a custom Activity Execution
9
9
type Activity interface {
10
-
10
+
11
11
// Metadata returns the metadata of the activity
12
12
Metadata () * Metadata
13
-
13
+
14
14
// Eval is called when an Activity is being evaluated. Returning true indicates
15
15
// that the task is done.
16
16
Eval (ctx Context ) (done bool , err error )
@@ -19,19 +19,21 @@ type Activity interface {
19
19
type Factory func (ctx InitContext ) (Activity , error )
20
20
21
21
type InitContext interface {
22
-
22
+
23
23
// Settings
24
24
Settings () map [string ]interface {}
25
-
25
+
26
26
// MapperFactory gets the mapper factory associated with the activity host
27
27
MapperFactory () mapper.Factory
28
-
28
+
29
29
// Logger logger to using during initialization, activity implementations should not
30
30
// keep a reference to this
31
31
Logger () log.Logger
32
-
33
- // Name returns name of the activity
32
+
33
+ // Name returns name of the activity / task
34
34
Name () string
35
+ // HostName returns name of the flow / task host
36
+ HostName () string
35
37
}
36
38
37
39
type Details struct {
Original file line number Diff line number Diff line change @@ -195,6 +195,10 @@ func (ctx *initCtx) Name() string {
195
195
return ""
196
196
}
197
197
198
+ func (ctx * initCtx ) HostName () string {
199
+ return ""
200
+ }
201
+
198
202
var activityLogger = log .ChildLogger (log .RootLogger (), "activity" )
199
203
200
204
// EvalActivity evaluates the specified activity using the provided inputs
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ type TestActivityInitContext struct {
88
88
settings map [string ]interface {}
89
89
factory mapper.Factory
90
90
name string
91
+ hostName string
91
92
}
92
93
93
94
func (ic * TestActivityInitContext ) Settings () map [string ]interface {} {
@@ -101,10 +102,15 @@ func (ic *TestActivityInitContext) MapperFactory() mapper.Factory {
101
102
func (ic * TestActivityInitContext ) Logger () log.Logger {
102
103
return logger
103
104
}
105
+
104
106
func (ic * TestActivityInitContext ) Name () string {
105
107
return ic .name
106
108
}
107
109
110
+ func (ic * TestActivityInitContext ) HostName () string {
111
+ return ic .hostName
112
+ }
113
+
108
114
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
109
115
// TestActivityHost
110
116
You can’t perform that action at this time.
0 commit comments