aboutsummaryrefslogtreecommitdiffstats
path: root/lib/agent/events.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-24 01:14:30 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-24 01:37:24 +0100
commit4d843d2bde236ec23810d0904dfb8aebbc53a37b (patch)
tree84c01452f01620cedb7bf6bcb608a0eade82161b /lib/agent/events.go
parent38c0c21a969e621c725245ce91c78e77076c5ce7 (diff)
New dashboard improvements.
- add build buttons - add build settings support and backup into project clientData - improved async alert - fixed project dropdown Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/agent/events.go')
-rw-r--r--lib/agent/events.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/agent/events.go b/lib/agent/events.go
index 9ff72ac..ccf8ddc 100644
--- a/lib/agent/events.go
+++ b/lib/agent/events.go
@@ -71,7 +71,7 @@ func (e *Events) UnRegister(evName, sessionID string) error {
}
// Emit Used to manually emit an event
-func (e *Events) Emit(evName string, data interface{}) error {
+func (e *Events) Emit(evName string, data interface{},fromSid string) error {
var firstErr error
if _, ok := e.eventsMap[evName]; !ok {
@@ -93,9 +93,10 @@ func (e *Events) Emit(evName string, data interface{}) error {
continue
}
msg := apiv1.EventMsg{
- Time: time.Now().String(),
- Type: evName,
- Data: data,
+ Time: time.Now().String(),
+ FromSessionID: fromSid,
+ Type: evName,
+ Data: data,
}
e.Log.Debugf("Emit Event %s: %v", evName, sid)
if err := (*so).Emit(evName, msg); err != nil {