Closed ayh20 closed 6 years ago
Thanks @ayh20. You are correct, Init() is deprecated, per the interfaces. We should implement Initialize()
type Trigger interface {
util.Managed
// Metadata returns the metadata of the trigger
Metadata() *Metadata
// Init sets up the trigger, it is called before Start()
//DEPRECATED
Init(actionRunner action.Runner)
}
// Init interface should be implemented by all Triggers, the Initialize method
// will eventually move up to Trigger to replace the deprecated "Init" method
type Init interface {
// Init initialize the Activity for a particular configuration
Initialize(ctx InitContext) error
}
flogogen trigger test will create template code that has:
trigger.go // Init implements trigger.Trigger.Init func (t *udpTrigger) Init(runner action.Runner) { t.runner = runner } rather than Initialize
trigger_test.go
is Init correct ?