File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed
Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ import (
77
88// Activity is an interface for defining a custom Activity Execution
99type Activity interface {
10-
10+
1111 // Metadata returns the metadata of the activity
1212 Metadata () * Metadata
13-
13+
1414 // Eval is called when an Activity is being evaluated. Returning true indicates
1515 // that the task is done.
1616 Eval (ctx Context ) (done bool , err error )
@@ -19,19 +19,21 @@ type Activity interface {
1919type Factory func (ctx InitContext ) (Activity , error )
2020
2121type InitContext interface {
22-
22+
2323 // Settings
2424 Settings () map [string ]interface {}
25-
25+
2626 // MapperFactory gets the mapper factory associated with the activity host
2727 MapperFactory () mapper.Factory
28-
28+
2929 // Logger logger to using during initialization, activity implementations should not
3030 // keep a reference to this
3131 Logger () log.Logger
32-
33- // Name returns name of the activity
32+
33+ // Name returns name of the activity / task
3434 Name () string
35+ // HostName returns name of the flow / task host
36+ HostName () string
3537}
3638
3739type Details struct {
Original file line number Diff line number Diff line change @@ -195,6 +195,10 @@ func (ctx *initCtx) Name() string {
195195 return ""
196196}
197197
198+ func (ctx * initCtx ) HostName () string {
199+ return ""
200+ }
201+
198202var activityLogger = log .ChildLogger (log .RootLogger (), "activity" )
199203
200204// 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 {
8888 settings map [string ]interface {}
8989 factory mapper.Factory
9090 name string
91+ hostName string
9192}
9293
9394func (ic * TestActivityInitContext ) Settings () map [string ]interface {} {
@@ -101,10 +102,15 @@ func (ic *TestActivityInitContext) MapperFactory() mapper.Factory {
101102func (ic * TestActivityInitContext ) Logger () log.Logger {
102103 return logger
103104}
105+
104106func (ic * TestActivityInitContext ) Name () string {
105107 return ic .name
106108}
107109
110+ func (ic * TestActivityInitContext ) HostName () string {
111+ return ic .hostName
112+ }
113+
108114/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
109115// TestActivityHost
110116
You can’t perform that action at this time.
0 commit comments