.
.
.
func (m module) GetEventFuncs() []eather.Fire {
return eventFuncs
}
var eventFuncs = []eather.Fire{
eather.Fire{Call: "added", Func: added},
eather.Fire{Call: "removed", Func: removed},
}
var added = func(data ...interface{}) {
fmt.Println(data)
time.Sleep(2 * time.Second)
fmt.Println("Running event after added")
}
var removed = func(data ...interface{}) {
fmt.Println(data)
time.Sleep(2 * time.Second)
fmt.Println("Running event after removed")
}
.
.
.
<?xml version="1.0" encoding="UTF-8"?>
<module>
<name>Empty</name>
<version>1.0.0</version>
<events>
<listener for="test_added" call="added" name="add_some_stuff"></listener>
<listener for="test_removed" call="removed" name="remove_some_stuff"></listener>
</events>
</module>